English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I know how to page threw a datagrid i use the folowing code

Protected Sub grid_PageIndexChanged(ByVal sender As System.Object, ByVal e As DataGridPageChangedEventArgs) Handles grid.PageIndexChanged
mygrid.CurrentPageIndex = e.NewPageIndex
mygrid.DataSource = mydataset
mygrid.DataBind()
End Sub

but how do i page a gridview. The event that handles paging does not like
mygrid.mypageindex
how do i change the code for the datagird to work for a dataview?

2007-01-16 05:03:11 · 2 answers · asked by csdraska 1 in Computers & Internet Programming & Design

2 answers

check out http://www.pscode.com for great examples.

2007-01-16 09:52:57 · answer #1 · answered by Richard H 7 · 0 0

The GridView makes paging even easier with its AllowPaging attribute. This attribute can be set either by adding the attribute to the GridView control in HTML mode or by checking the Enable Paging checkbox in the GridView’s smart tag. Enabling paging in the GridView control defaults to a page size of 10records and adds the Pager to the bottom of the grid.


DataKeyNames=”CustomerID” AutoGenerateColumns=”False”
AllowSorting=”True” AllowPaging=”True”>


Thank You.

2007-01-16 05:59:42 · answer #2 · answered by Smutty 3 · 0 0

fedest.com, questions and answers