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.

SfDataPager with database-side filtering and sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

124004 May 7,2016 07:37 AM May 17,2016 10:48 AM UWP 6
loading
Tags: SfDataPager
Jasper_E
Asked On May 7, 2016 07:37 AM

I would like to create a paged and editable grid with database-server-side filtering and sorting.

The database table I'm presenting holds millions of records which can't all be sent to the client device. Yet I would like the end user to be able to quickly filter and sort the full dataset.
The ideal solution would be a table sortable by column, with a filter row, where the filter row and sorting applies to the full database table. Not just the locally fetched records.

Can this be achieved with the SfDataPager and SfDataGrid? 
Are there any samples available which demonstrate the client-side functionality?



Jai Ganesh S [Syncfusion]
Replied On May 9, 2016 08:47 AM

Hi Jasper, 
You can achieve your requirement for sort and filter the database records in DataPaging. We have a Datapaging and OndemandPaging in SfDataGrid.  In DataPaging, you can load the entire source and perform operations but in OndemadPaging, you can load the records at on demand for each page. 
 
You can sort the complete collection with ‘OnDemandPaging’ by using SfDataGrid.SortColumnChangingevent. In this event, you can sort the complete underlying collection instead of sorting current page alone by resetting the caches. 
 
 
Could you please let us know, in which database you are using in your application? This would be more helpful for us to create the simple sample to achieve your requirements. 
 
 
Regards, 
Jai Ganesh S 


Jasper
Replied On May 12, 2016 06:21 AM

Hi Jai,

I implemented the database sorting with the help documentation you provided.

However, filter rows and column filtering don't seem to work":
  • UI filtering is not supported when using on-demand paging by setting UseOnDemandPaging to true.
    Source: http://help.syncfusion.com/wpf/sfdatagrid/filtering#ui-filtering

  • FilterRow is not supported in SfDataGrid.
    Source: http://help.syncfusion.com/wpf/sfdatagrid/paging
Can you tell me if it's possible to achieve a filter row or column filtering with ondemand paging?

Jasper
Replied On May 12, 2016 06:32 AM

PS. 
If I enable the filterrow in the grid it is displayed, but as soon as you choose a filter mode such as "equals", the application will crash with a NullReferenceException

If i enable gridfiltering, no filter options appear in the grid header.


Jai Ganesh S [Syncfusion]
Replied On May 13, 2016 07:59 AM

Hi Jasper, 
 
We regret to inform you that, UI filtering and Filter row is not supported in On-demand paging. This is the limitation to use Undemand paging. However, you can apply the filter at runtime in On-demand paging and please find the following UG for more details, 
 
UG Link: 
 
Regards, 
Jai Ganesh S 
 


Jasper
Replied On May 14, 2016 05:27 AM

Yea I figured as much.

I was looking for a solution to use the filter row in a mode which only shows the filter row, but doesnt actually actively filter anything inside the control dataset.

With for example an OnFilterChanged event I could then translate the filters applied filters to the database backend.

This however doesn't seem to be possible because setting the filterrow triggers a Null exception.

Jai Ganesh S [Syncfusion]
Replied On May 17, 2016 10:48 AM

Hi Jasper, 
 
In On Demand paging , the records are populated dynamically and we are not getting all the records. So we cannot perform the UI filtering in this case. Hence we suggested to use filtering the records at runtime. Could you please find the sample for this from the UG link as we already provided. 
 
Regards, 
Jai Ganesh 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.

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.

;