Winforms Datagrid with server side pagination with custom sql query?
Hi how i can manage datagrid but instead of client side pag use server side pagination? right now im loading a sql table with 50k, i dont like to see all 50k records,i will like to only display lets say 200 records per page. Any tips?
note: i know SQL server have an option in the select query to add a LIMIT and OFFSET i think
thank you
Hi Alexis Gaitan,
Your requirement to only display 200 records per page and load all
records can be achieved by using paging. You can bind the datasource to the
SfDataPager and set the PageSize to display the desired number of records per
page.
UG Link:Paging
in WinForms DataGrid control | Syncfusion
Find the sample demo in the attachment.
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_fc007e47.zip
So synfusion auto paginate? But it uses client side or server side?
Alexis Gaitan,
The PageSize of SfDataPager is set to 200, but it's receiving 50,000 records
from the server. Initially, the FirstPage displays the first 200 records. When
the next button is clicked, another set of 200 records is displayed. This
operation is performed on the client side.
it will be always on client side? no way to put server side pagination?
Alexis Gaitan,
While a WinForms SfDataGrid typically operates on the client
side, you can implement server-side pagination by fetching data from the server
as needed. We have prepared the simple sample for achieve your
requirement. Find the sample demo in the
attachment.
Note: This setup simulates server-side pagination by fetching data based
on the page number and size whenever needed. Adjust the FetchDataFromServer
method to retrieve data from your server source and modify the OrderInfo class
and SfDataGrid to suit your specific data structure and display requirements.
If this post is helpful, please consider Accepting it as the solution so that
other members can locate it more quickly.
Attachment: SfDataGridDemo_d4429c9d.zip
but for faster perfomance what you recommend? client or server side?
Alexis Gaitan,
The performance of
the Datagrid should work properly on both the client side and the server side.
Suppose you have a problem(Delay),fetching data from the server; at that time,
the performance of the Datagrid will be affect.
Regards,
Santhosh.G
So for 50k records is ok to use client side
Hi Alexis Gaitan,
Yes, you can use 50k records in the client side.
- 9 Replies
- 4 Participants
- Marked answer
-
AG Alexis Gaitan
- Nov 30, 2023 01:46 PM UTC
- Dec 22, 2023 01:27 PM UTC