Page 1 of 1

MySubscriptions - sorting

Posted: Wed Jun 10, 2015 3:27 am
by mbartens
I'd like the grid to default to ordering by ExpirationDate Descending. I tried changing it on the SubscriptionDs but it doesn't seem to have any affect. What am I doing wrong?

Original:

Code: Select all

                    <asp:ObjectDataSource ID="SubscriptionsDs" runat="server" SelectMethod="LoadForUser" UpdateMethod="Update" OldValuesParameterFormatString="original_{0}"
                        TypeName="CommerceBuilder.Orders.SubscriptionDataSource" 
                        DataObjectTypeName="CommerceBuilder.Orders.Subscription" 
                        onselecting="SubscriptionDs_Selecting" SortParameterName="sortExpression" EnablePaging="true" >
                        <SelectParameters>
                            <asp:Parameter Name="userId" DefaultValue="0" Type="Int32" />
                            <asp:Parameter Name="sortExpression" DefaultValue="Id DESC" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
Here's the part I modified:

Code: Select all

                            <asp:Parameter Name="sortExpression" Type="String" DefaultValue="ExpirationDate DESC" />

Re: MySubscriptions - sorting

Posted: Wed Jun 10, 2015 5:16 am
by nadeem
Remove SortParameterName="sortExpression" from ObjectDataSource to work this correctly.

Re: MySubscriptions - sorting

Posted: Thu Jun 11, 2015 4:24 am
by mbartens
Thank you that did it. :)