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.
Unfortunately, activation email could not send to your email. Please try again.

Filtering,sorting,grouping on an sfDataGrid when the itemSource is an IncrementalList

Thread ID:

Created:

Updated:

Platform:

Replies:

127868 Dec 14,2016 10:04 AM Dec 22,2016 10:18 AM WPF 5
loading
Tags: SfDataGrid
Reece Squires
Asked On December 14, 2016 10:04 AM

Is there a way to do this that filters,sorts,groups the list the IncrementalList is loading from? If not is there an event I can hook into when the filter or sort or group process is fired? this way I could resort the master list I have a large amount of records to add to a grid, using a traditional list as the itemSource makes the sfDatagrid unusable. 

Balamurugan Rajaraman [Syncfusion]
Replied On December 15, 2016 10:49 AM

 Hi Reece,  
We have analyzed your query “Filtering,sorting,grouping on an sfDataGrid when the itemSource is an Incremental List”. You can able to perform the basic operation of Sorting, Grouping and filtering in the incremental loading list. And you have to set the LiveDataUpdateMode as "AllowDataShaping" to update the UI when manipulating the data with grid operations like Sorting, Grouping and Filtering.  
Please refer the below UG link to know more about LiveDataUpdateMode.  
UG Links: 
Incremental Loading: 
LiveDataUpdateMode: 
Sample Link: 
Let us know if you have any further assistance in this. 
Regards, 
Balamurugan. 


Reece Squires
Replied On December 19, 2016 10:08 AM

Hey

This doesn't quite offer the solution we need, unfortunately this still only sorts currently loaded items and not all items. In your example you are loading them from a web service so it makes sense for that, however we have the entire list in memory. The list is filtered into the UI to prevent the UI from loading slowly. When the filter button is clicked we need to filter the entire list that is in memory and then have the grid display a new set of items from that newly filtered list. I was hoping for an event that I could override when someone clicks the filter button so that I can then reorganise my master list that is in memory and just take the top 50 from that. An example of the problem;
Master list has 200 rows
Displays Rows 1-50 in the UI to start with.
Filter ID in descending order and the UI displays Rows 50-1 
I need it to display 200-150 instead and completely refresh the itemsource

Balamurugan Rajaraman [Syncfusion]
Replied On December 20, 2016 08:43 AM

Hi Reece, 

We have analyzed your query. You expect that you need to apply data operations like sorting or grouping to entire collection in Incremental Loading. But in SfDataGrid the data operations (Sorting/Grouping/Filtering) are get applied only the records which in current view and it will updated when the incremental list collection is changed. So we suggested you to use VirtualizingCollectionView instead of Increamental loading.  
 
For more information about Virtualizing CollectionView please check the below UG link: 


Let us know if you have any specified reason for using the incremental loading in your application or else could you please share your exact requirement? It would be better for us and provide a better solution. 

Regards, 
Balamurugan. 


Reece Squires
Replied On December 21, 2016 09:29 AM

Hey, this has almost solved my problem although the data only refreshes when I click a filter since I've written an extension for the GridVirtualizingCollectionView.
The goal is this:
I hvae an SfDataGrid that has aprox. 70 columns and around 2,000 rows and it needs to load those in  as quickly as possible. Currently I am doing this;
My extension class called GridVirtualizingCollectionViewExt take an argument in it's of type IEnumerable<T>
it then takes 100 items from that and passes that to the base constructor of GridVirtualizingCollectionView.
Then in my constructor I start a task that takes the full list, sleeps for half a second and then uses the SetSource function to the master collection.
This has worked in the sense I can now load the items in considerably quicker than before. However, I need the grid to redraw after calling SetSource but it does not. If i click a filter button it will redraw the entire list and filter it. I need the redraw without clicking that filter. The reasons for this are as follows:
If you use the drag and drop Group by functionality of the sfDataGrid it will ONLY group the items that have been drawn.
If you use the filter option that lets you filter individual rows, it will also ONLY filter on items that have already been draw.
If you force a redraw by clicking sort by then the other two bits of functionality will then work as intended but I need that drawing capability after I've loaded the items in successfully. 
Is there a way to do this? is there sample code? the documentation doesn't help too much as I do not have direct access to the grid in code, so I need to trigger this via the bound list somehow

Balamurugan Rajaraman [Syncfusion]
Replied On December 22, 2016 10:18 AM

Hi Reece, 
 
We are not able to understand your query clearly. Based on your provided details, we have prepared a sample by overriding the SetSource method in GridVirtualizingCollectionView which is working fine in our side. We have attached the tested sample and please modify the attached sample based on your application. It will be more helpful for us to analyze further on your problem. 
 
Sample Link: 
 
 
 
Regards, 
Balamurugan. 


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.

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.

;