Hello,
after applying OutlookGroupBy the grid is broken down into nice sections. Lets say the grid is grouped by states, the sections will go as.
Alabama row rowAlaska row row
etc.
Notice that the groups, are now sorted alphabetically. Is it possible to apply custom sort on the groups? I have a case where alphabetic sort does not make sense there.
i.e.
Micro cap row rowSmal cap row rowMid cap rowLarge cap row row
1. Are you using the Column Key in the formula...Try other columns to see if you can get any string value into the mask...this worked for me but always seemed quite dodgy!
2. I haven't used it for multiple groups, but if they end up being multiple bands, likely you can set the mask at the band level perhaps. I would be surprised if you couldn't adjust the mask at each level of the grouping...however I haven't needed to do this so am not entirely sure...
awesome, thanks for the well thought out reply.
i thought about this approach, but
1. didn't know how to override the name from the sort column number to another columns value (which you figured out how to get around), but when i do [max:ValueColumn] which is a string, it just returns 0 for every group.
2. how will this work in a scenario with multiple groupBy columns ? GroupByRowDescriptionMaskDefault is a grid property, so you can only override the group by name for one of the columns?
so i still have 2 problems with this solution
I had the same requirement which was to be able to sort descending on alpha which the group by has no option for...
Iachieved this by creating a SORT_ORDER column...for each lot of rows in a group, they would have the same sort order...then grouping by the SORT_ORDER column you will get the rows in order. But this means you get the Group By Description of like 0,1,2 or whatever. But you can can set the description format or mask for the group by rows...In the InitializeLayout event use the following code:
UltraWebGrid1.DisplayLayout.GroupByRowDescriptionMaskDefault = "[max:COLUMN_NAME] ([count]) "
This code sets the mask to be the max value of the COLUMN_NAME in that group (the column you would normally have been grouping by)...so in your case it may be STATE_NAME or STATE_DESC...as well as putting the count of the number of items in that group...
The following data:
ID STATE_DESC CITY_DESC SORT_ORDER1 New York New York 12 New York Blah 13 Washington Seattle 24 Oregon Portland 3so you would use the group by mask: [max:STATE_DESC] ([count])and would be grouping by the SORT_ORDER columnnote: as the STATE_DESC is now the group by row, it will appear in the grid...you will need to hide it if necessary
this would produce the following grid:
New York (2) 1 New York 2 BlahWashington (1) 3 SeattleOregon (1) 4 Portland
And as you can see, the groups would not be alphabetically sorted but instead sorted however you wanted them to be...
hope that helps!just thought i'd add a code block from a simple app:Protected Sub UltraWebGrid1_InitializeLayout(ByVal sender As Object, ByVal e As LayoutEventArgs) Handles UltraWebGrid1.InitializeLayout
With UltraWebGrid1
.DisplayLayout.ViewType = ViewType.OutlookGroupBy.Columns.FromKey("SORT_ORDER").IsGroupbyColumn = True.DisplayLayout.GroupByRowDescriptionMaskDefault = "[max:STATE_DESC] ([count]) ".Columns.FromKey("STATE_DESC").Hidden = True
End With
End Sub