Portlight
Portlight

Reputation: 95

Adding pagination to a DataGridView

I am working on a VB project - net 2.0. It has been a long time since I have worked in .net and I need a little refresher.

How would I add pagination to this piece of code:

  'AdvDataGrid
    '
    Me.AdvDataGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
    Me.AdvDataGrid.Location = New System.Drawing.Point(881, 37)
    Me.AdvDataGrid.Margin = New System.Windows.Forms.Padding(4)
    Me.AdvDataGrid.Name = "AdvDataGrid"
    Me.AdvDataGrid.Size = New System.Drawing.Size(661, 546)
    Me.AdvDataGrid.TabIndex = 67

Upvotes: 0

Views: 2643

Answers (1)

user3525511
user3525511

Reputation:

Portlight, As you may know, pagination isn't an inherint element to the windows forms datagridview. However, with the bindingnavigator and binding source, you can achieve the results you are looking for. I have researched this solution, that I found in C#. However, you can easily convert the code to vb.net. I instruct you to the original document so that you can follow and understand the concept. Be mindful, the article has a link to StackOverflow for additional options and understanding. Sorry, but pagination can not be added to your code - much is needed to achieve your results. http://dotnetgenetics.blogspot.com/2013/11/datagridview-paging-using.html

Upvotes: 1

Related Questions