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

After CRUD event the grid call the DataManager but doesnt refresh the data

Hi There.

I have a Grid that the data is linked with the DataManager, I can manage to trigger and do the actions but when the Grid calls the Data the second time after the CRUD action, the data is not updated on the Grid, and even the response from the DataManager is with the updated information, what can I do?

   [WebMethod, ScriptMethod(UseHttpGet = false)]
    public static void NotesInsert(Dictionary<string, object> value, string action){

          ... /logic/... all working.


<ej:DataManager runat="server"  ID="gvNotesData" URL="EmployeeUpdateUAT_N.aspx/NotesGet" Adaptor="WebMethodAdaptor"  InsertURL="EmployeeUpdateUAT_N.aspx/NotesInsert" >     

<ej:Grid ID="gvEmployeeNote" runat="server" AllowPaging="true" AllowTextWrap="true" DataManagerID="gvNotesData"  >
                                <EditSettings AllowEditing="false" AllowAdding="true" AllowDeleting="false"></EditSettings>
                                <ToolbarSettings ShowToolbar="true" ToolbarItems="add,update,cancel"></ToolbarSettings>
                                <TextWrapSettings WrapMode="Content" />
                                    <ej:Column Field="Notes" Width="40%" AllowTextWrap="true" HeaderTextAlign="center"   EditType="StringEdit">
                                            <ej:KeyValue Key="required" Value="true"  />
                                            <ej:KeyValue Key="minlength" Value="true" />
                                    <ej:Column Field="LastUpdate" HeaderText="Last Update" HeaderTextAlign="center"  AllowEditing="false" Format="{0:dd/MM/yyyy HH:mm}" Width="12em" TextAlign="Right"   />
                                    <ej:Column Field="CreatedBy" AllowEditing="false"  Width="12em" HeaderTextAlign="center"  /> 
                                    <ej:Column Field="NoteCategoryId" EditType="DropdownEdit" HeaderText="Category" HeaderTextAlign="center" 
                                        ForeignKeyValue="NoteCategoryName" TextAlign="Left" >
                                            <ej:KeyValue Key="required" Value="true"  />
                                    <ej:Column Field="DueDate" AllowEditing="false" HeaderText="Due date" HeaderTextAlign="center"  />
                                    <ej:Column Field="Completed" EditType="BooleanEdit" TextAlign="Center"  AllowEditing="false" HeaderTextAlign="center"  />
                                    <%--  <ej:Column Field="NoteCategoryName" />--%>

Thanks in advance.

1 Reply

VN Vignesh Natarajan Syncfusion Team February 7, 2019 07:01 AM UTC

Hi Nestor, 
Thanks for contacting Syncfusion Support. 
Query#:- The data is not updated on the Grid, and even the response from the DataManager is with the updated information, what can I do? 
We have checked your query and we have prepared sample as per your code example but we are unable to reproduce your reported problem at our end. The new records has been inserted properly on the dataSource.  While checking your code example you have not enabled IsPrimaryKey property in anyone of the columns  which is necessary to perform Editing operations. So we suggest you to enable IsPrimaryKey property. 
Refer to the code example:- 
    <ej:Grid ID="FlatGrid" runat="server" AllowPaging="true" AllowGrouping="true" AllowFiltering="true" AllowSorting="true" AllowSearching="true"> 
           <DataManager URL="/Default.aspx/DataSource"  Adaptor="WebMethodAdaptor" UpdateURL="/Default.aspx/UrlUpdate" InsertURL="/Default.aspx/UrlInsert" RemoveURL="/Default.aspx/UrlDelete" /> 
                <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="75" /> 
                <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="80" /> 
                  .    .     . 
Kindly refer the below link for the importance of prirmarykey column while performing CRUD action. 
Please get back to us if you have further queries. 
Vignesh Natarajan 

Live Chat Icon For mobile
Up arrow icon