Hi Robert,
After you set the current page for the DataGrid, you need to set the DataSource and any other settings for the datagrid. The standard approach is to use a custom method (like BindDataGrid) and it performs all the binding. Then you call that routine from PageIndexChanged event.
>hi!
>
>i put a datagrid onto my webform which displays data in a dataset (source=sql-server). the datagrid is limited to 10 entries the others are available over 'paging'.
>
>i put the following code onto my webform:
>
>Private Sub myGrid_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles myGrid.PageIndexChanged
> Me.myGrid.CurrentPageIndex = e.NewPageIndex
> Me.myGrid.DataBind()
>End Sub
>
>
>on one webform everything is ok but on the other webform when the paging event is executed the datagrid dispears.
>
>any ideas?
>TIA
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi