How do I achieve pagination or paging in sfdatagrid winforms?

I am using WinForms using vb,net language and expect the solution in same language.
Now I want to do is load data from database. Say I have big data and I want to load it partially. 
The on-demand feature in paging suits me well. 
I want that on page change, I get data from database because getting all data first from the database is not convenient way for me as it takes long time.
Please give solution in vb.net
Thanks


1 Reply

VS Vijayarasan Sivanandham Syncfusion Team October 30, 2023 06:19 PM UTC

Hi Urvik,

By default, the SfDataPager does not support the DataTable as the DataSource. So, your requirement can be achieved by converting the DataTable into IEnumerable collections and bound with SfDataPager. Please find the following UG link for the limitation.  

UG link: Paging in WinForms DataGrid control | Syncfusion

However, we have prepared the sample to meet your requirements. Please find the sample in the attachment.

Note: SfDataPager has a few limitations when the `OnDemandPaging’ is enabled case. We have mentioned in our user documentation as a limitation of SfDataPager. Please refer to the below link for your reference,

UG Link: Paging in WinForms DataGrid control | Syncfusion

If you are using the SfDataGrid with paging and want to utilize the DataTable collection, you can convert the DataTable to a dynamic collection. However, be aware that using large amounts of data with this conversion may negatively impact performance.

Regards,
Vijayarasan S


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.



Attachment: Sample_38f44d93.zip

Loader.
Up arrow icon