- Home
- Forum
- ASP.NET Web Forms
- After CRUD event the grid call the DataManager but doesnt refresh the data
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:DataManager>
<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" />
<Columns>
<ej:Column Field="Notes" Width="40%" AllowTextWrap="true" HeaderTextAlign="center" EditType="StringEdit">
<ValidationRule>
<ej:KeyValue Key="required" Value="true" />
<ej:KeyValue Key="minlength" Value="true" />
</ValidationRule>
</ej:Column>
<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"
ForeignKeyField="NoteCategoryId"
ForeignKeyValue="NoteCategoryName" TextAlign="Left" >
<ValidationRule>
<ej:KeyValue Key="required" Value="true" />
</ValidationRule>
</ej:Column>
<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" />--%>
</Columns>
</ej:Grid>
Thanks in advance.
SIGN IN To post a reply.
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" />
<Columns>
<ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" TextAlign="Right" Width="75" />
<ej:Column Field="CustomerID" HeaderText="Customer ID" Width="80" />
. . .
</Columns>
</ej:Grid> |
Refer to the Demo Link:- https://asp.syncfusion.com/demos/web/grid/webmethodadaptor.aspx
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.
Regards,
Vignesh Natarajan
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
NO Nestor Ochoa
- Feb 7, 2019 02:15 AM UTC
- Feb 7, 2019 07:01 AM UTC