Hi,
I'm aware you can set a grouping level programtically, by adding a FieldSortDescription. I'm also aware you can use FieldSettings to control the "AllowGroupBy" property.
This *nearly* works well! I run the project, expand the group by area and see the grid has correctly been grouped by "Name". The three fields for which I've allowed gropuing, appear below.
However, the grid allows me to drag the "Name" grouping (which I was trying to force as 'always on'), to the bottom section... when I do so, the grid un-groups and the "Name" button in the group by area disappears!
Is this incorrect behaviour? Or is there any way to control it that I've missed?
Regards,
Dave
Hello Dave,
I am not completely sure if this is the correct behavior of the XamDataGrid. If you have set AllowGroupBy to false globally and then explicitly just set AllowGroupBy only to Type, Category 1 and Category 2 , then this is expected, as the Name would have AllowGroupBy false and will disappear.
I believe I did something like this in the forum, but cannot seem to find it right now, but :
Creating a style for the GroupByFieldLabel and using a DataTrigger with Binding Field.Name and Value Name (in your case) and setting the Visibility property to Collapsed would do the trick.
<Style TargetType="{x:Type igDP:GroupByFieldLabel}">
<Style.Triggers>
<DataTrigger Binding="{Binding Field.Name}" Value="Name">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
Hi Alex,
Your suggestion worked great in prior releases, but now the latest version is using GroupByAreaMultiPanel objects, it no longer works.
Have you got any ideas how I could achieve this in v9.2? I had a quick look but couldn't see any easy way to get to "Field.Name"....
Cheers,
Hello Alex,
Excellent idea! Worked a treat, hadn't thought of trying that.
Thanks,