|
|
Автор:
|
Fil
|
|
Тема:
|
Постраничный вывод в DataGrid
|
|
Дата:
|
9/19/2001 3:28:00 PM
|
Такой скрипт выводит линки на страницы, но не переключается между страницами (все время первая страница отображается)
Как быть?
Sub BindGrid()
Dim MyConnection As SqlConnection = New SqlConnection("server=(local)\NetSDK;database=pubs;Trusted_Connection=yes")
Dim MyCommand As SqlCommand = New SqlCommand("select * from Authors", MyConnection)
MyConnection.Open()
Dim dr As SqlDataReader = MyCommand.ExecuteReader()
MyDataGrid.DataSource = dr
MyDataGrid.VirtualItemCount=200
MyDataGrid.DataBind()
MyConnection.Close()
End Sub 'BindGrid
Sub MyDataGrid_Page(sender As Object, e As DataGridPageChangedEventArgs)
MyDataGrid.CurrentPageIndex = e.NewPageIndex
BindGrid()
End Sub
....
<asp:DataGrid id="MyDataGrid" runat="server"
AllowPaging="True"
AllowCustomPaging="true"
PageSize="10"
OnPageIndexChanged="MyDataGrid_Page"
>
|
|