Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: How to display current page number in datagrid


Message #1 by "Peter Afonin" <pva@s...> on Mon, 2 Dec 2002 19:04:57 -0800
Hello:

I'm using paging in the datagrid. How do I display a current page number in
the label? If I use something like this:

Me.lblPages.Text = "Page " & Me.dgCLBC.CurrentPageIndex.ToString & " of  " &
Me.dgCLBC.PageCount.ToString

(where dgCLBC is a datagrid name) it doesn't work.
Me.dgCLBC.CurrentPageIndex.ToString produces weird random numbers.

I would appreciate your help very much.

Thank you,

--
Peter Afonin


Message #2 by "Carole D Sullivan" <carolesullivan@e...> on Wed, 4 Dec 2002 00:57:57
 lblPageNumber.Text = "Page " & dgEarnSearch.CurrentPageIndex + 1 & " 
of " & dgEarnSearch.PageCount

Make sure you do it again whenever you change pages.

> 
Hello:

I'm using paging in the datagrid. How do I display a current page number 
in
the label? If I use something like this:

Me.lblPages.Text = "Page " & Me.dgCLBC.CurrentPageIndex.ToString & " 
of  " &
Me.dgCLBC.PageCount.ToString

(where dgCLBC is a datagrid name) it doesn't work.
Me.dgCLBC.CurrentPageIndex.ToString produces weird random numbers.

I would appreciate your help very much.

Thank you,

--
Peter Afonin


Message #3 by "Peter Afonin" <pafo@s...> on Wed, 4 Dec 2002 13:41:02 -0800
Thank you, Carole, this works.

Peter

"Carole D Sullivan" <carolesullivan@e...> wrote in message
news:241582@a..._beginners...
>
>  lblPageNumber.Text = "Page " & dgEarnSearch.CurrentPageIndex + 1 & "
> of " & dgEarnSearch.PageCount
>
> Make sure you do it again whenever you change pages.
>
> >
> Hello:
>
> I'm using paging in the datagrid. How do I display a current page number
> in
> the label? If I use something like this:
>
> Me.lblPages.Text = "Page " & Me.dgCLBC.CurrentPageIndex.ToString & "
> of  " &
> Me.dgCLBC.PageCount.ToString
>
> (where dgCLBC is a datagrid name) it doesn't work.
> Me.dgCLBC.CurrentPageIndex.ToString produces weird random numbers.
>
> I would appreciate your help very much.
>
> Thank you,
>
> --
> Peter Afonin
>
>
>
>



  Return to Index