smriti Posted March 4, 2005 Posted March 4, 2005 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 Quote
rfazendeiro Posted March 4, 2005 Posted March 4, 2005 (edited) 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 Edited March 4, 2005 by rfazendeiro Quote
smriti Posted March 7, 2005 Author Posted March 7, 2005 hi, i got it. just use view states in place of shared variables. Thanks, smriti Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.