How can I set the skip value to 0 in SfGrid when a value is entered in the Search text and Enter is pressed?
Hi Buza,
Before proceeding with the reporting of the problem, we require some additional
clarification from your end. Please share the following details to proceed
further on our end:
The details
requested above will be very helpful in validating the reported query on our
end and providing a solution as soon as possible. Thanks for your
understanding.
Regards,
Prathap S
Hi Prathap,
Based on your requirements, we suggest using the 'Searching' event to set the skip value as 0 whenever searching. By adjusting the skip value accordingly, you can achieve your desired outcome. Please refer to the code snippet and documentation below for more details.
|
<SfGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Search" })"> <GridEvents Searching="SearchingHandler" TValue="Order"></GridEvents> </SfGrid> public void SearchingHandler(SearchingEventArgs args) { SKipValue = 0; // Here, you can customize your code. }
|
Reference: https://blazor.syncfusion.com/documentation/datagrid/events#searching
Hi Prathap,
The Searching="SearchingHandler" event doesn't have an effect if Adaptor="Adaptors.UrlAdaptor". The only solution I found is the OnActionBegin="ActionBegin" event.
private void ActionBegin(ActionEventArgs<CityModel> args)
{
if (args.RequestType == Syncfusion.Blazor.Grids.Action.Searching || args.RequestType == Syncfusion.Blazor.Grids.Action.Filtering)
{
args.CurrentPage = 1;
}
}
Thanks for the update,
We are happy to hear that the issue you reported has been resolved at your end. We are closing the thread now.