Paging for MyOrderHistory.aspx

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
User avatar
bha
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 44
Joined: Tue Mar 11, 2008 6:04 pm

Paging for MyOrderHistory.aspx

Post by bha » Wed Mar 18, 2009 2:00 am

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? :D

Thanks,
Bruce.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Paging for MyOrderHistory.aspx

Post by mazhar » Wed Mar 18, 2009 6:20 am

Edit ascx file and adjust order grid as

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">
now edit the code file and add following method

Code: Select all

protected void OrderGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        OrderGrid.PageIndex = e.NewPageIndex;
        OrderGrid.DataBind();
    }
it will fix paging.

User avatar
bha
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 44
Joined: Tue Mar 11, 2008 6:04 pm

Re: Paging for MyOrderHistory.aspx

Post by bha » Wed Mar 18, 2009 7:27 am

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!

Post Reply