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

Multiple Properties In Group Descriptor

1 Answer 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 16 Apr 2013, 11:11 AM
HI,

 I was wondering if it was possible to use a combination of properties in GroupDescriptor.

For example:

I have the data set: 
new DummyModel { Name = "Bob", Test = "A", Part = "i", Score = 12},
new DummyModel { Name = "Bob", Test = "A", Part = "ii", Score = 11},
new DummyModel { Name = "Bob", Test = "B", Part = "i", Score = 15},
new DummyModel { Name = "Bob", Test = "B", Part = "ii", Score = 16},
new DummyModel { Name = "Sue", Test = "A", Part = "i", Score = 6},
new DummyModel { Name = "Sue", Test = "A", Part = "ii", Score = 14},
new DummyModel { Name = "Sue", Test = "B", Part = "i", Score = 22},
new DummyModel { Name = "Sue", Test = "B", Part = "ii", Score = 18},

I would like to group by Name and Test and show the sum of the two parts (ordered by Name, then Test).

I recently had this working by adding a property to DummyModel that had both a Name and Test Properties and implemented IComparable and overwrote Equals and GetHashCode which allowed the grouping and sorting as I desired.I used this property as the Member property of the GroupDescriptor.

However this stopped working when we upgraded to v4.0.30319.

Any help on this issue would be greatly appreciated.

Thanks,

Steven

1 Answer, 1 is accepted

Sort by
0
Steven
Top achievements
Rank 1
answered on 16 Apr 2013, 12:29 PM
I have spent a bit of time over lunch and tried this in a standalone project and it worked so it looks like the issue is somewhere on our end (though nothing has changed in these files for months...).

Sorry for jumping the gun a bit.

Thanks
Tags
GridView
Asked by
Steven
Top achievements
Rank 1
Answers by
Steven
Top achievements
Rank 1
Share this question
or