.NETGURU
ASP DataGrid Paging
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngescalate' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Rick Kolesar
-- Moved from [aspngwebcontrols] to [aspngescalate] by Click here to reveal e-mail address --Listmaster - Please post to webcontrols list, as it is really about the operation of the DataGrid Web control. You moved it to the data list before and I haven't had a response.Thanks====================================================================Has anyone else noticed a problem with the behavior of paging a DataGridwhen the PagerStyle Mode is set to Numeric Pages and you have a large numberof pages?If you use the next "..." buttons to move forward more than two sets ofpages, the previous "..." buttons no longer function, they don't repositionthe grid back.Here's my Grid: (followed by the Codebehind snippet)==================<asp:DataGrid id=dg runat="server" ForeColor="Black"AutoGenerateColumns="False"ShowFooter="True"AllowPaging="True" PageSize="20"OnPageIndexChanged="OnGridPageIndexChanged"AllowSorting="True"OnSortCommand="dg_Sort"OnEditCommand="dg_Edit"OnCancelCommand="dg_Cancel"OnUpdateCommand="dg_Update"OnDeleteCommand="dg_Delete"OnItemCreated="dg_ItemCreated"><Columns> <asp:BoundColumn HeaderText="Market Id" DataField="Id" SortExpression="Id"> <HeaderStyle Width=100px /> </asp:BoundColumn> <asp:BoundColumn HeaderText="Name" DataField="Name" SortExpression="Name"> <HeaderStyle Width=250px /> </asp:BoundColumn> <asp:BoundColumn HeaderText="Mgr Id" DataField="ManagerId"SortExpression="Name"> <HeaderStyle Width=100px /> </asp:BoundColumn> <asp:EditCommandColumn EditText="Edit" CancelText="Cancel" UpdateText="OK" ItemStyle-Wrap="false" HeaderStyle-Wrap="false" > <HeaderStyle Width=40px /> </asp:EditCommandColumn> <asp:ButtonColumn HeaderText="" ButtonType="LinkButton" Text="Delete"CommandName="Delete"> <HeaderStyle Width=55px /> </asp:ButtonColumn></Columns><PagerStyle ForeColor="white" BackColor="Green" Font-Size="10pt"Font-Bold="True"Position="top" HorizontalAlign="left" PageButtonCount="10"Mode="NumericPages" /><HeaderStyle Font-Bold="True" ForeColor="White" BackColor="Green" /><FooterStyle ForeColor="white" BackColor="green" /><ItemStyle Font-Size="10pt" Font-Names="Verdana" Font-Bold="True"BackColor="PapayaWhip" /><AlternatingItemStyle BorderColor="Transparent" BackColor="LightGreen" /><SelectedItemStyle BorderColor="Transparent" BackColor="white" /></asp:DataGrid>=========================protected void OnGridPageIndexChanged( object sender,DataGridPageChangedEventArgs e ){    dg.CurrentPageIndex = e.NewPageIndex;    FillGrid( SortExpression );}private void FillGrid( string sKey ){ string sLang = Session["UserLanguageId"].ToString();    int iCount = 0;    DataSet ds = new DataSet();    Oram oOram = new Oram();    oOram.GetMarkets( sLang, Session["OrganizationId"].ToString(),    Session["RegionId"].ToString(), Session["AreaId"].ToString(),    ds, refiCount );    ViewState["iCount"] = iCount;        // save for later display    DataView dv = new DataView( ds.Tables["myTable"] );    string sort = SortExpression;    if ( SortAscending == false )    {        sort += " desc";    }    dv.Sort = sort;    dg.DataSource = dv;    dg.DataBind();}_________________________________________________________________Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Reply to this message...
 
    
Charles M. Carroll (VIP)
At 02:22 PM 8/29/2001 -0700, you wrote:
[Original message clipped]

The [aspngwebcontrols] list is only for notebook tab, tree, toolbar and
multi-page controls. It has nothing to do with Data controls. The rules @
http://www.asplists.com/asplists/aspngescalate.asp?Tab=rules
shows an elegant way to get unanswered questions answered.

Reply to this message...
 
 
System.Data.DataSet
System.Data.DataView
System.Web.UI.WebControls.BoundColumn
System.Web.UI.WebControls.ButtonColumn
System.Web.UI.WebControls.DataGrid
System.Web.UI.WebControls.DataGridPageChangedEventArgs
System.Web.UI.WebControls.EditCommandColumn
System.Web.UI.WebControls.HorizontalAlign
System.Web.UI.WebControls.LinkButton
System.Windows.Forms.DataGrid




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification