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. Image for the cookie policy date
close icon

some issues

Dear All

I have created a small app to get some more practice in the grid component.

But what should I say I face some issues and I do not see what I am doing wrong

I have attached a sample which shows the issues and as well a small video what shows the issue as well.

1. issue
                            <ej:Grid ID="Grid1" runat="server"  AllowResizeToFit="true" AllowPaging="true" AllowTextWrap="true" OnServerEditRow="Grid1_ServerEditRow"                             

will not be hit in code behind if I edit the Row

2. issue

by editing the row alays the frst row is taken, even if I select the second row.

what dis I do wrong?

Cheers Martin

Attachment: CustomAttributes_43c5da9a.zip

3 Replies

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team January 9, 2017 11:29 AM UTC

Hi Martin, 
 
Thanks for contacting Syncfusion Support. 
 
Query #1: Server Events not triggered. 
 
We have checked your sample which doesn’t have ej.webforms.min.js which is the cause of the problem. We have already discussed about this in the following KB. 
 
 
Please follow the KB and resolve the issue at your end. 
 
Query #2: Editing the row always the first row is taken, even if I select the second row 
 
We are able to reproduce the problem at our end when the IsPrimaryKey is not defined for read-only column of the Grid. To perform the editing/deleting action in the Grid, you have to mention the primaryKey (read-only) column in the Grid. Because, based on this read-only column alone, save/delete of any records takes place in the Grid. 
 
We have also discussed about the necessity of the PrimaryKey in the following KB. 
 
 
Refer to the following Help Document for Editing. 
 
 
 
Refer to the following code example. 
 
    <ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True"> 
 
       <Columns> 
            <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" /> 
            <ej:Column Field="CustomerID" HeaderText="Customer ID" /> 
                  . . . 
                      . .  
        </Columns> 
    </ej:Grid> 
 
From your code example, we could see you are using Auto-generation of Columns feature in Grid. With this feature, we can assign the IsPrimaryKey for the respective (or read-only) column in the DataBound event of the Grid. Refer to the following Help Document. 
 
 
Regards, 
Seeni Sakthi Kumar S. 



MS Martin Sickel January 10, 2017 02:47 PM UTC

Thanks a lot, I was able to fix this, but I still face some issues :-(

Maybe you can give me some other hints.

I address the Data to the grid via WebAPI, my Controller for this looks like that

        public object GetAttributes()
        {
            var dt = Database.db.GetCustomAttributes(Properties.Settings.Default.DBCon);
            string json = JsonConvert.SerializeObject(dt, Formatting.Indented);
            JArray customAttributes = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(json);
            return new { result = customAttributes, count = customAttributes.Count() };
        }

The response looks like this

{
  "result": [
    {
      "WORKGROUP": "Homemade",
      "AV_PARTNER": "Inv",
      "BUSINESS_UNIT": "Operation",
      "COMPANY": "Invoco",
      "COMPLEXITY": "Advanced",
      "CONTACT_INTENSITY": "Intern",
      "COST_CENTER": null,
      "E_WFM_QUEUE": null,
      "INTERNAL_EXTERNAL": "External",
      "LANGUAGE": "German",
      "OUTBOUND_ANI": null,
      "OUTBOUND_MAIL_ADDRESS": null,
      "OUTBOUND_MAIL_NAME": null,
      "OVERRIDE_ROUTING": null,
      "PARTNER_ROUTING_ACTIVE": null,
      "PARTNER_TARGET_NUMBER": null,
      "QUEUE_GROUP": "800",
      "QUEUE_TYPE": "Call Inbound",
      "SALES_POTENTIAL": "0",
      "SERVICE_GROUP": "10RES",
      "SHORT_NUMBER": null,
      "SIGNATURE": null,
      "TIMEOUT": null,
      "UNIT": null,
      "USE_SALUTATION": null,
      "USE_SIGNATURE": null,
      "WAIT_FOR_AGENT_PROMPT": null,
      "WORKGROUP_SERVICE": "Advanced_Activation_OTOID_Call",
      "ACD_PRIORITY": null,
      "IN_QUEUE_TIME_LIMIT_TARGET_WG": null,
      "IN_QUEUE_TIME_LIMIT": null,
      "SUPERVISOR_ROLE": null,
      "OP_BA_01": null,
      "OP_BA_02": null,
      "OP_BA_03": null,
      "OP_BA_09": null,
      "OP_BA_10": null,
      "OP_BA_04": null,
      "OP_BA_05": null
    },
    {
      "WORKGROUP": "myBestFriends",
      "AV_PARTNER": null,
      "BUSINESS_UNIT": "Operation",
      .........

the reponse in total is about 800 rows

two things:

1. The grid is so slow by presenting the data, her is how I have the grid setup, as you can see I have not defined the columns, I take them from the Data itself.

                    <ej:Grid ID="Grid1" AllowPaging="True" AllowScrolling="True" AllowResizeToFit="true" AllowTextWrap="True" runat="server"  OnServerEditRow="Grid1_ServerEditRow">
                        <DataManager Adaptor="WebApiAdaptor" URL="/api/Attributes"/>
                        <EditSettings AllowEditing="True"></EditSettings>
                        <ScrollSettings Height="800" Width="auto" />
                        <ToolbarSettings ShowToolbar="True" ToolbarItems="edit,update,cancel,search"></ToolbarSettings>
                        <FilterSettings FilterBarMode="Immediate" ShowFilterBarStatus="True" StatusBarWidth="300"></FilterSettings>
                        <ClientSideEvents DataBound="setPrimaryKey" />
                    </ej:Grid>

2. If I try to edit one set, it is very slow until I am able to modify it, and after modifying I am not able to save it. It is also not possible to edit a second row.

What did I do wrong?
How can I speed the things.

Thanks for helping

Martin




SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team January 11, 2017 01:16 PM UTC

Hi Martin,  
 
We are able to reproduce the problem at our end.  
 
Since you have defined the AllowResizeToFit property to the Grid, by default it will take some time to complete the initiation. To assign width to all the columns, Grid will iterate all the columns only for the AllowResizeToFit enabled Grid. This behavior is also applicable to the Editing also.  
 
Regards, 
Seeni Sakthi Kumar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon