|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
DataGrid NOT PagingI 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 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 > > 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 > > > > > > > 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 >> > >> > >> >> >> 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 > 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 >> > > >
Webform Navigation
Can't set button to Visible? Need reviews and advice on web and data control tools and vendors databind - XmlNodeList to DropDownList Is someone willing to help me with a simple VB example? Skin and custom controls (ASP 2.0) custom web controls and conversion to inline code Reach UserControl from ASPX codebehind? Web Custom Control using a property displaying current form text boxes Dynamically populating and expanding TreeView from button click... |
|||||||||||||||||||||||