I have a client that has a huge order history. Their complaint that when they click on See All>>, it takes too long to load up their entire history. A natural solution would be to add paging to this query.
I may be wrong, but MyOrderHistoryPage.ascx is not set up to handle paging.
I added AllowPaging = "True" to the OrderGrid and was able to get the first page with paging tabs. However, when the page number is clicked, an exception is thrown.
"The GridView 'OrderGrid' fired event PageIndexChanging which wasn't handled. "
Can someone provide a solution to this?
Thanks,
Bruce.
Paging for MyOrderHistory.aspx
Re: Paging for MyOrderHistory.aspx
Edit ascx file and adjust order grid as
now edit the code file and add following method
it will fix paging.
Code: Select all
<asp:GridView ID="OrderGrid" runat="server" AutoGenerateColumns="False" ShowHeader="false" GridLines="none"
Width="100%" CellPadding="4" RowStyle-CssClass="altodd" AlternatingRowStyle-CssClass="alteven" AllowPaging="true" PageSize="20" OnPageIndexChanging="OrderGrid_PageIndexChanging">
Code: Select all
protected void OrderGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
OrderGrid.PageIndex = e.NewPageIndex;
OrderGrid.DataBind();
}
Re: Paging for MyOrderHistory.aspx
This works beautifully and thanks for the quick response!!!
My only add was to make SkinID="PagedList" in the GridView section to get the nicely formatted page clicks.
Cheers!
My only add was to make SkinID="PagedList" in the GridView section to get the nicely formatted page clicks.
Cheers!