Datagridview pagination in C# windows application [duplicate]
Hai guys,
- Can we implement default p开发者_开发百科agination like asp:gridview for a datagridview in a c# windows application?
- Any samples to get started?
Create Button as Last , First, Prev , Next
Implement the page function
Next( less than total increase current page position , And reload data source )
Prev ( more than 1 decrease current page position and reload data source ) .. and so on
- Write two SQLs for the following :
- get row counts of your search query
- get query result with no. of rows skipped and limit (no. of records per page)
Remarks: try to find any functions for SQL such as limit , offset to skip the rows
Most of the tutorials use SQL : select top N ..where not in ( select top b*N ) ... where N is the no. of records per page , b is the offset parameters ( current page - 1 ) to skip result rows.
Beware the performance issues occured when querying the large result.
Sure, this is a very frequently asked question. Just look at this and this.
精彩评论