开发者

Datagridview pagination in C# windows application [duplicate]

This question already has answers here: How can we do pagination in datagridview in winform (8 answers) Closed 8 years ago.

Hai guys,

  • Can we implement default p开发者_开发百科agination like asp:gridview for a datagridview in a c# windows application?
  • Any samples to get started?


  1. Create Button as Last , First, Prev , Next

  2. 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

  1. Write two SQLs for the following :
    1. get row counts of your search query
    2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜