This is a migrated thread and some comments may be shown as answers.

Load more data when filter returns no matches

1 Answer 40 Views
DataGrid
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 1
Gregory asked on 24 Nov 2018, 06:21 PM
I'm currently using a DataGrid that uses incremental loading to increase load time. When I use a FilterDescriptor to filter the rows in the DataGrid it will only look through the currently loaded rows. Is there a way I can load in more data when the FitlerDescriptor returns no rows?

1 Answer, 1 is accepted

Sort by
0
Accepted
Didi
Telerik team
answered on 27 Nov 2018, 12:26 PM
Hello Gregory,

You could achieve the described approach through DataGrid FilterRequested command.

You would need to create a class, for example MyFilterRequestedCommand, that inherits from DataGridCommand. Then handle the FilterRequested action as a command. and override its CanExecute and Execute methods. Inside the Execute method you can get the items after filtering using the DataView and implement your custom logic is there is no data after filtering.

Please take a look at the MainPage.xaml.cs file how this could be implemented. I have also left comments for reference.

Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataGrid
Asked by
Gregory
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or