|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Paging In GridView bound to DataSetIs there a reasonable way to implement paging in a GridView control that's
bound to a DataSet rather than a SqlDataSource? What needs to be done? Thanks you don't have to change anything
paging will work in a GridView whether it's bound to SqlDataSource or a DataSet http://raven/aspxtreme/sys/web/ui/webcontrols/demos/gridviewdatasource.aspx ooops I posted the wrong link that's in my local host :) so here goes
http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/demos/gridviewdatasource.aspx Thanks for your reply.
I initially just bound the GridView to the DataSet, and ran it. It worked fine until I clicked a page number. At that point it gave me an error about the OnPageIndexChanging being raised but not handled, so I implemented it as such: protected void gvSrchMatch_PageIndexChanging(object sender, GridViewPageEventArgs e) { gvSrchMatch.PageIndex = e.NewPageIndex; } This runs, but does not page correctly. The help file on this event speaks of canceling the move to the next page, but not actually making the control move to the next page. Interestingly, your demo crashes when you click a page link... Elton Show quoteHide quote "ReyN" <rvnu***@hotmail.com> wrote in message news:1160005059.054713.53370@e3g2000cwe.googlegroups.com... > > ooops I posted the wrong link that's in my local host :) so here goes > > http://authors.aspalliance.com/aspxtreme/sys/web/ui/webcontrols/demos/gridviewdatasource.aspx > you have to rebind the GridView after setting the PageIndex in the
event handler Thanks, I repopulated the grid, set the index, and bound and it appears to work. I think caching the dataset might make it more efficient. It seems wrong to get the whole dataset each time...
protected void gvSrchMatch_PageIndexChanging(object sender, GridViewPageEventArgs e) { gvSrchMatch.DataSource = PvrProfile.GetMatches(txtSrchLastName.Text); gvSrchMatch.PageIndex = e.NewPageIndex; gvSrchMatch.DataBind(); } Show quoteHide quote "ReyN" <rvnu***@hotmail.com> wrote in message news:1160125886.530853.110650@h48g2000cwc.googlegroups.com... > > you have to rebind the GridView after setting the PageIndex in the > event handler >
Javascript alert message problem
Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of 'ASP.WebForm1_aspx' Confirm Message in gridview Calendar Web Control Object data source, setting parameter source to Page.Partner.Guid Search in .NET User controls and LoadControl method Slow File Upload Speed IIS 6.0 ASP.net 2.0 RowCommand Event of a nested Gridview RegularExpressionValidator |
|||||||||||||||||||||||