Hi Manolo,
Thanks for contacting Syncfusion support.
To maintain the selection of the records even after searching for the values we suggest you to define the field value for the checkbox column. Please refer the below code example.
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowScrolling()
.AllowSorting() /*Sorting Enabled*/
.AllowPaging() /*Paging Enabled*/
.AllowSearching()
.SelectionType(SelectionType.Multiple)
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Search);
});
})
.Locale("es-ES")
.Columns(col =>
{
col.Type("checkbox").Field("Select").Width(50).Add();
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();
|
For your convenience we have modified the provided sample with the mentioned changes and please download the sample from the following link
Regards,
Prasanna Kumar N.S.V