Hi Patrick,
Thanks for contacting Syncfusion support.
Normally search operation perform the searching in Grid based on the given data source. If we give only 4 fields for presentation details and performing the search operation in Grid, then it searches the whole data source and returned matches rows in all fields instead of given 4 fields.
So the input value has should be in result of the matched rows in any other fields. We can check the result the data after searching by call the getCurrentViewData() method in console window. We suspect this is cause of the issue and suggest you to use refer to the following code example for resolve this issue,
Code example:
@(Html.EJ().Grid<EmployeeView>("RowTemplate")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowScrolling()
.ScrollSettings(scroll => { scroll.Height(380).Width(500); })
.ToolbarSettings(toolbar => { toolbar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.Search); }); })
.RowTemplate("#templateData")
.ClientSideEvents(e=>e.ActionBegin("ActionBegin").ActionComplete("ActionComplete"))
.Columns(col =>
{
. . .
})
)
<script>
function ActionBegin(args) {
if (args.requestType == "searching")
this.model.searchSettings.fields = ["LastName", "FirstName", "Title"]; // here we can search the Grid with given fields. So it will returned the results only matched items.
}
</script> |
We have also created a sample for your convenience which can be download from following link,
If you still face the same issue, then could you please provide following details?
1) Essential studio version details
2) Issue replication procedure.
3) Screenshot of Grid with search input.
4) Screenshot of search results.
5) A sample if possible or modify the given sample as issue reproducible.
Regards,
Venkatesh Ayothiraman.