We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Two questions about the Grid Control

Thread ID:

Created:

Updated:

Platform:

Replies:

120897 Oct 26,2015 01:01 PM UTC Nov 2,2015 05:06 AM UTC ASP.NET Web Forms 8
loading
Tags: Grid
Jorge Pampin
Asked On October 26, 2015 01:01 PM UTC

Hello,

I'm using the Grid Control. The Grid is configured to in Batch mode, and it upadte the data with a WebMethod. How to show a message if the update has errors?

In the client side I have some columns in readonly mode, but I want to edit the cells of these columns when I create a new row, how to do that?.

Thanks!

Gowthami V [Syncfusion]
Replied On October 27, 2015 09:51 AM UTC

Hi Jorge,
Thanks for using Syncfusion products.

Query 1: The Grid is configured to in Batch mode, and it update the data with a WebMethod. How to show a message if the update has errors?

We can show an error message using the client side event “ActionFailure” when the Grid actions are not completed.

We have an issue “ActionFailure API is missing in ASP.NET Wrapper” and created a new support incident under your account. . Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

We have tried to achieve your requirement using below workaround solution,

  <ej:Grid ID="EmployeesGrid" runat="server" Width="1500px" AllowPaging="true" >
. . . .

<EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" EditMode="batch"></EditSettings>
                    <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>
. . . .

<ClientSideEvents Create="create" />
            </ej:Grid>

  <script type="text/javascript">

          function create(args) {

              this.option("actionFailure", "FailMessage");

             

          }

          function FailMessage(args) {

              // args.error.error().statusText will display the status of the action failure

              alert(args.error.error().statusText);
          }

</script>
</asp:Content>


In the above code example, we have bound the actionFailure event to the grid in Create event and displayed the error message when the Grid action (update) is not completed.

Query 2: In the client side I have some columns in readonly mode, but I want to edit the cells of these columns when I create a new row, how to do that?

We understood that you have set the “AllowEditing” as false (readonly) for the particular column.

We can achieve your requirement using below code example,


<ej:Grid ID="EmployeesGrid" runat="server" Width="1500px" AllowPaging="true" >
. . . .

  <ClientSideEvents Create="create" ToolbarClick="click"/>

</ej:Grid>

      <script type="text/javascript">

          function create(args) {

//Storing editing disabled columns details initially

              window.data = this._disabledEditableColumns;


          }

          function click(args)

          {


              if (args.itemName == "Add")

                  this._disabledEditableColumns = [];

              else

                  this._disabledEditableColumns = window.data;

          }

        
</script>


Regards,
Gowthami V.


Jorge Pampin
Replied On October 27, 2015 03:17 PM UTC

Hello,

Can you send me a project sample of the second queston? I don't undestand well the solution.

Thanks!

Gowthami V [Syncfusion]
Replied On October 28, 2015 11:27 AM UTC

Hi Jorge,

We have created the below sample with enable “Batch”
 edit mode with the workaround provided in the previous update.


http://www.syncfusion.com/downloads/support/forum/120897/ze/ASPSample1286863648

We have set the allowEditing as “false” for the CustomerID field (read-only). While adding a new row, the read-only columns can be edited.


Regards,
Gowthami V.

Jorge Pampin
Replied On October 28, 2015 12:59 PM UTC

Hello,

I can't reproduce it in my project. I think it is because my grid is in an ascx control instead of a aspx page, am I right?

Thanks!

Gowthami V [Syncfusion]
Replied On October 29, 2015 11:32 AM UTC

Hi Jorge,

We have created a sample with WebUserControl (ascx control) but we are unable to reproduce the issue. 

Please refer to the sample,


http://www.syncfusion.com/downloads/support/forum/120897/ze/SampleDemo-WebUserControl821778871.zip

Please provide below details to reproduce the issue,

1.       Code example used for editing.
2.       Reproduce the issue in the above sample and share.
3.       Details of issue that you have faced while using our solution.

The provided information will help to analyze the issue and provide a solution as early as possible.

Regards,

Gowthami V.

Jorge Pampin
Replied On October 30, 2015 08:16 AM UTC

Hello,

Finally it works! There was an error in my code.... But, if the readonly column is a checkbox, when I edit the new row instead of a checkbox control appears the text "False"/"True".

Thansks!

Jorge Pampin
Replied On October 30, 2015 11:49 AM UTC

Hello,

I've solved it with DisplayAsCheckbox="True" EditType="Boolean"

Thanks!

Gowthami V [Syncfusion]
Replied On November 2, 2015 05:06 AM UTC

Hi Jorge,
 
We are happy to hear that your issue has been resolved. 
 
Get back to us if you need further assistance.
 
Thanks & Regards,
 
Gowthami V.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;