Click here to Skip to main content
15,861,172 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi...
I have a WPF Datagrid which I've grouped by a column ProductName. I want to perform sorting on UploadDate which is a datefield. The issue here is on clicking on sort I want the data to be sorted on UploadDate within the groups, by the datagrid sorts the data based on the ProductName, on which I've grouped the rows. Due to this the groups are re-ordered.

How can I stop the default sorting on group name????

Example

I have a datagrid with 2 groups and I've grouped them on ProductName
Group 1 : BProduct ---> This is the Product Name
There are 2 rows in this group
04/31/2012
01/31/2012

Group 2 : AProduct ---> This is the Product Name
There are 2 rows in this group also.
04/31/2012
01/31/2012

On Sorting I want the data to sort within groups, the result I expect is

Group 1 : BProduct
There are 2 rows in this group
01/31/2012
04/31/2012

Group 2 : AProduct
There are 2 rows in this group also.
01/31/2012
04/31/2012

But the datagrid sorts on group name as well....the actual result is

Group 1 : AProduct
There are 2 rows in this group
01/31/2012
04/31/2012

Group 2 : BProduct
There are 2 rows in this group also.
01/31/2012
04/31/2012
Posted
Updated 5-Dec-12 1:17am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900