This is a migrated thread and some comments may be shown as answers.

Sorting a group

2 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 10 Oct 2011, 04:32 PM
Hello,

I have searched through the forums and either not found a solution that solves my problem, or was unable to get it to function how I wanted.

I have a set of data that looks like this:

Item#        Item edition date        last updated date
123            12/1/2010                    6/1/2011
123            11/1/2010                    2/1/2011
123            2/2/2010                      3/1/2010
555            6/30/2011                    7/5/2011
555            4/1/2011                      5/1/2011
666            1/1/2010                      12/31/2010
666            10/1/2009                    12/31/2009


I would like to group the data by the Item#, which I can do, but then I want the groups sorted by the last updated date only, which I cant do. The SQL I use to get the data performs the grouping and sorting correctly, but its not reflected when I bind it. I am using AdvancedDatabinding as well.

Any suggestions/help?

2 Answers, 1 is accepted

Sort by
0
Justin
Top achievements
Rank 1
answered on 11 Oct 2011, 12:54 PM
Some more info:

By using this example http://www.telerik.com/community/forums/aspnet-ajax/grid/sorting-groups.aspx

I can get the groups to sort by last updated date, but it doesnt group all the records with the same item number. So I guess to be more specific I would like the item numbers to be grouped, but the groups sorted on the last updated timestamp of the first record in each group. Is this possible?
0
Iana Tsolova
Telerik team
answered on 12 Oct 2011, 04:05 PM
Hi Justin,

You can sort the groups only by Item# by odding SortOrder in the GroupByExpression. Then to sort the items in each group, you can do it by adding SortExpression for the grid MasterTableView.

Greetings,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Justin
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or