Home All Groups Group Topic Archive Search About
Author
16 Jun 2005 11:13 PM
TCORDON
I have a DataGrid with this properties set:

AllowPaging = True
PagerStyle/Mode = NumericPages

In my form_Load:

If not(me.ispostback) then
    ' Some code to get the data into DS...
    grdItems.DataSource = DS.Tables(0).DefaultView
    grdItems.DataBind
endif

It binds the data ok but when i click another page number....nothing happens
it seems it does a PostBack but displays the same records.

TIA

Author
16 Jun 2005 11:49 PM
Scott M.
All you've done is said that you want to "Allow Paging".  The DataGrid does
not implement the actual paging functionality automatically, you must write
the paging code yourself.

Public Sub DataGrid1_PageIndexChanged(Sender..., e As ....)....
    DataGrid1.CurrentPageIndex = e.NewPageIndex
    DataGrid1.DataBind
End Sub


Show quoteHide quote
"TCORDON" <tcord***@hotmail.com> wrote in message
news:usuDLkscFHA.2552@TK2MSFTNGP14.phx.gbl...
>I have a DataGrid with this properties set:
>
> AllowPaging = True
> PagerStyle/Mode = NumericPages
>
> In my form_Load:
>
> If not(me.ispostback) then
>    ' Some code to get the data into DS...
>    grdItems.DataSource = DS.Tables(0).DefaultView
>    grdItems.DataBind
> endif
>
> It binds the data ok but when i click another page number....nothing
> happens it seems it does a PostBack but displays the same records.
>
> TIA
>
>
Author
21 Jun 2005 2:56 PM
kw_uh97
Thanks Scott, I was perusing the boards trying to get my paging problems
answered and ran acroos your post. It worked perfectly.

Oh by the way, I'm guessing here??? I have ordered your book "ASP.NET Data
Web Controls Kick Start" and look forward to learning everything about web
data controls.

Thanks Again,
kw_uh97

Show quoteHide quote
"Scott M." wrote:

> All you've done is said that you want to "Allow Paging".  The DataGrid does
> not implement the actual paging functionality automatically, you must write
> the paging code yourself.
>
> Public Sub DataGrid1_PageIndexChanged(Sender..., e As ....)....
>     DataGrid1.CurrentPageIndex = e.NewPageIndex
>     DataGrid1.DataBind
> End Sub
>
>
> "TCORDON" <tcord***@hotmail.com> wrote in message
> news:usuDLkscFHA.2552@TK2MSFTNGP14.phx.gbl...
> >I have a DataGrid with this properties set:
> >
> > AllowPaging = True
> > PagerStyle/Mode = NumericPages
> >
> > In my form_Load:
> >
> > If not(me.ispostback) then
> >    ' Some code to get the data into DS...
> >    grdItems.DataSource = DS.Tables(0).DefaultView
> >    grdItems.DataBind
> > endif
> >
> > It binds the data ok but when i click another page number....nothing
> > happens it seems it does a PostBack but displays the same records.
> >
> > TIA
> >
> >
>
>
>
Author
21 Jun 2005 9:00 PM
Scott M.
Glad to help.  Although, I am not the same Scott M. as the author of the
book you mention.


Show quoteHide quote
"kw_uh97" <kwu***@discussions.microsoft.com> wrote in message
news:1FE50514-5F32-47B9-BEA0-62CC5EC8A156@microsoft.com...
> Thanks Scott, I was perusing the boards trying to get my paging problems
> answered and ran acroos your post. It worked perfectly.
>
> Oh by the way, I'm guessing here??? I have ordered your book "ASP.NET Data
> Web Controls Kick Start" and look forward to learning everything about web
> data controls.
>
> Thanks Again,
> kw_uh97
>
> "Scott M." wrote:
>
>> All you've done is said that you want to "Allow Paging".  The DataGrid
>> does
>> not implement the actual paging functionality automatically, you must
>> write
>> the paging code yourself.
>>
>> Public Sub DataGrid1_PageIndexChanged(Sender..., e As ....)....
>>     DataGrid1.CurrentPageIndex = e.NewPageIndex
>>     DataGrid1.DataBind
>> End Sub
>>
>>
>> "TCORDON" <tcord***@hotmail.com> wrote in message
>> news:usuDLkscFHA.2552@TK2MSFTNGP14.phx.gbl...
>> >I have a DataGrid with this properties set:
>> >
>> > AllowPaging = True
>> > PagerStyle/Mode = NumericPages
>> >
>> > In my form_Load:
>> >
>> > If not(me.ispostback) then
>> >    ' Some code to get the data into DS...
>> >    grdItems.DataSource = DS.Tables(0).DefaultView
>> >    grdItems.DataBind
>> > endif
>> >
>> > It binds the data ok but when i click another page number....nothing
>> > happens it seems it does a PostBack but displays the same records.
>> >
>> > TIA
>> >
>> >
>>
>>
>>
Author
16 Jun 2005 11:51 PM
Brock Allen
Do you actually handle the OnPage event fired from the Grid?

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I have a DataGrid with this properties set:
>
> AllowPaging = True
> PagerStyle/Mode = NumericPages
> In my form_Load:
>
> If not(me.ispostback) then
> ' Some code to get the data into DS...
> grdItems.DataSource = DS.Tables(0).DefaultView
> grdItems.DataBind
> endif
> It binds the data ok but when i click another page number....nothing
> happens it seems it does a PostBack but displays the same records.
>
> TIA
>
Author
17 Jun 2005 10:51 PM
Scott M.
It's not the onPage event that needs handling, its the PageIndexChanged
event that needs handling.


Show quoteHide quote
"Brock Allen" <ballen@NOSPAMdevelop.com> wrote in message
news:917563632545483038313760@msnews.microsoft.com...
> Do you actually handle the OnPage event fired from the Grid?
>
> -Brock
> DevelopMentor
> http://staff.develop.com/ballen
>
>
>
>> I have a DataGrid with this properties set:
>>
>> AllowPaging = True
>> PagerStyle/Mode = NumericPages
>> In my form_Load:
>>
>> If not(me.ispostback) then
>> ' Some code to get the data into DS...
>> grdItems.DataSource = DS.Tables(0).DefaultView
>> grdItems.DataBind
>> endif
>> It binds the data ok but when i click another page number....nothing
>> happens it seems it does a PostBack but displays the same records.
>>
>> TIA
>>
>
>
>