How can you group off one column but sort on another column through code??
I have one column that has the group name "string" lets say 'ROOM' but the order they need to be displayed is an int lets say "Room Order" so I have data like
Bedroom, 2, 'Some Info1'
Bedroom, 2, 'Some Info2'
Bedroom, 2, 'Some Info3'
Kitchen, 1, 'Some Info1'
Kitchen, 1, 'Some Info2'
Kitchen, 1, 'Some Info3'
Bathroom, 3, 'Some Info1'
Bathroom, 3, 'Some Info2'
I want to group off of the ROOM column but sort offer the Room Order column, however, once I group it always sorts off the group column, in this example ROOM
I have tried bringing in the data already sorted it does help. I have also tried following code:
Me
.gvRoomNights.Columns("ROOM_SORT_ORDER_SITE").Sort(RadSortOrder.Ascending, True)
Dim expression As New GridGroupByExpression("[ROOM_POOL_CD] as [Room Pool] Group By [Room Pool]")
'Dim expression2 As New GridSortField("[ROOM_SORT_ORDER_SITE]")
gvRoomNights.EnableSorting =
True
gvRoomNights.MasterTemplate.EnableSorting =
True
gvRoomNights.MasterTemplate.GroupDescriptors.Add(expression)
Me.gvRoomNights.Columns("ROOM_SORT_ORDER_SITE").Sort(RadSortOrder.Ascending, True)
'gvRoomNights.MasterTemplate.SortDescriptors.Add(expression2)
gvRoomNights.Columns(
"ROOM_POOL_CD").Width = 60
I guess I could group by the ROOM SORT ORDER but I need to change the Groups HEader text to the actual room name. If you can show me that I would be able to get around this. Thanks.
Eric