Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted (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 by rfazendeiro

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...