paging in datagrid

smriti

Regular
Joined
Jan 7, 2005
Messages
54
hi all,

I want to display number of rows in grid in each page like
"starting row to end row of total rows"
i am using paging in the grid.

I manged to do so by using shared variables for staring row , end row nd total rows and
incrimented and decrimented correspondingly when navigated to next page.

But if i took two browsers then as i used shared variables i am getting problems.

Can any one give me a suggestion to do this.

Thanks
 
A datagrid has allow paging it self.

<asp: DataGrid id="DataGrid1" AllowPaging="true" PageSize="10" OnPageIndexChanged="page_Datagrid" AutoGenerateCollumns="false" RunAtServer="True"></asp: DataGrid>


Here you say that the datagrid will use paging

Here you say how many rows you want to show

Here you control dta paginf itself
sub page_Datagrid(o As Object, e AS DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
DataGrid1.DataSource = some datasource you may have
DataGrid1.DataBind()
End Sub

 
Last edited:
Back
Top