We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Overwrite default SfDataGrid filtering behaviour to map to external data provider

Thread ID:

Created:

Updated:

Platform:

Replies:

150445 Jan 7,2020 03:12 PM UTC Jan 9,2020 01:50 PM UTC WPF 3
loading
Tags: SfDataGrid
Floris Verhoeven
Asked On January 7, 2020 03:12 PM UTC

Hello,

I'm using the DataGrid control with the built-in filter row and excel-like filter pop-up. The default behaviour here is that filtering is done in-memory. That's great in most cases but I'm now facing a scenario with a list of 200k items which is why I'm using the IncrementalList pattern. 

Because I'm now loading my data from my database as the user scrolls, the in-memory filtering no longer meets the requirements as it now only searches the already loaded data. I would like to map the SF FilterPredicates to my database while maintaining the built-in filter row and popup. However I'm struggling to find the correct way to overwrite this default in-memory filtering behaviour. What's the recommended way of achieving this behaviour?

Kind regards,

Floris

Susmitha Sundar [Syncfusion]
Replied On January 8, 2020 12:24 PM UTC

Hi Floris, 
 
Thank you for using Syncfusion controls. 
 
In Incremental loading, Filter popup shows already loaded data only. This is default behavior of GridFilterControl. You can’t change this behavior by overriding the filter predicates. If you want to load the all data in GridFilterControl, you can use the GridVirtualizationCollectionView instead of Incremental loading. But we have limitations for GridVirtualizationCollectionView, it does not support for DataTable. Please refer the more details from below UG link, 
 
 
Please let us know if you need further assistance on this. 
 
Regards, 
Susmitha S 


Floris Verhoeven
Replied On January 8, 2020 04:28 PM UTC

Hello Susmitha,

Thanks for your reply. I indeed understand that using the Excel-like filter popup is not possible without loading all the data. 

However, I would still like to use the FilterRow without loading all the data. What happens now:
  • Load first 100 records
  • Enter filter text in one of the column
  • SfDataGrid internally filters the currently loaded data set
  • Filtered results based on first 100 records and entered filter text are shown
What I would like to do:
  • Load first 100 records
  • Enter filter text in one of the column
  • Intercept event and get entered filtered text
  • Translate the filter to my external data source
  • Get the new records based on my own query
  • Filtered results based on my own result set, so basically reset the item source of the datagrid
Would that be something that's possible right now?

Kind regards,

Floris

Susmitha Sundar [Syncfusion]
Replied On January 9, 2020 01:50 PM UTC

Hi Floris, 
 
Thank you for your update. 
 
We have checked the incremental loading. In our sample, we have total records count as 100 and we initially loaded the 50 items. If you are using Excel like filtering, you can filter only 50 records. But if you are using FilterRow, you can able to filter the all 100 records. Please check our sample and video link, 
 
 
 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back with your Syncfusion updated version
 
It will be helpful for us to check on it and provide you the solution at the earliest.   
 
Regards, 
Susmitha S 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon