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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl and DataPagerExt

Thread ID:





112409 Sep 20,2013 02:15 PM UTC Oct 15,2013 03:56 AM UTC WPF 1
Tags: GridControl
Alan White
Asked On September 20, 2013 02:15 PM UTC

I am currently using the GridDataControl to list data from the database, but the data is presented via a WCF mechanism that returns a given number of records each time.
With this in mind, having looked at the samples for DataPagerExt, none of them seems to match my requirement, as they appear to read all the data into memory, then page through this on request.
In the interests of using this myself, is there some way in which I can get hold of events issued when the page buttons are changed and control the paging in this way?
I've looked at PageIndexChanged and PageIndexChanging, but these seem to fire when changing the page of buttons, not when the actual buttons are clicked to trigger a grid page change.
I've also looked at using SfDataPager, but this seems to function in a very similar way to DataPagerExt.

Divya A [Syncfusion]
Replied On October 15, 2013 03:56 AM UTC

Hi Alan,

We regret for the delay caused.

We can use OnDemandDataSourceLoad event of the DataPager. We can load the itemsSource to the grid OnDemand as required from this event. We have also prepared a sample based on your requirement and provided in the following location:

Code Snippet:

dataPager.OnDemandDataSourceLoad += new GridDataOnDemandPageLoadingEventHandler(dataPager_OnDemandDataSourceLoad);
void dataPager_OnDemandDataSourceLoad(object sender, GridDataOnDemandPageLoadingEventArgs e)
WpfApplication1.ServiceReference2.Service1Client dataContext = this.AssociatedObject.DataContext as WpfApplication1.ServiceReference2.Service1Client;
var param = new PageInfo(e.PagedRows, e.MaximumRows);
grid.ItemsSource = dataContext.OnDemandDataSourceLoad(param.StartIndex, param.EndIndex);

Sample: WcfServiceLibrary1.zip





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