Hi,
I am using the grid to display some data.
I have the delete functionality, but when executing, the grid is not refreshed, meaning the row has not been removed on screen.
Here is how I do.
In the Razor Page
public JsonResult OnPostDelete([FromBody]ICRUDModel<MyData> value)
{
return new JsonResult(value);
}
In the view .cshtml
List<object> toolbarItems = new List<object>();
toolbarItems.Add(new { text = "Search", align = "Left" });
toolbarItems.Add(new { text = "Delete", align = "Right" });
<ejs-grid id="Grid"
load="onLoad"
rowSelected="rowSelected"
rowDataBound="rowBound"
allowExcelExport="true"
allowPaging="true"
allowResizing="true"
AllowTextWrap="true"
allowSorting="true"
allowFiltering="true"
toolbarClick="toolbarClick"
toolbar="@toolbarItems">
<e-grid-editSettings allowEditing="true"
allowDeleting="true"
mode="Normal"
showDeleteConfirmDialog="true"></e-grid-editSettings>
<e-data-manager url="/?handler=DataSource"
updateUrl="/?handler=Update"
removeUrl="/?handler=Delete"
adaptor="UrlAdaptor"></e-data-manager>
<e-grid-columns>
<e-grid-column field="Id" isPrimaryKey="true" headerText="Id" textAlign="Center" width="120"></e-grid-column>
<e-grid-column field="Description" headerText="Description" width="200" allowEditing="false"></e-grid-column>
<e-grid-column field="Comment" headerText="Comments" validationRules="@(new { maxLength=100})" width="150" template="#templateComment"></e-grid-column>
</e-grid-columns>
</ejs-grid>
The OnPostDelete method is being called, but the grid still displays the deleted row.
Please spot what I am doing wrong.
Thank you!