1

Hai guys,

  • Can we implement default pagination like asp:gridview for a datagridview in a c# windows application?
  • Any samples to get started?
kiran
  • 13
  • 1
  • 1
  • 7

2 Answers2

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

Jeff Bootsholz
  • 2,971
  • 15
  • 70
  • 141
0

Sure, this is a very frequently asked question. Just look at this and this.

Restuta
  • 5,855
  • 33
  • 44