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
Dave,
This is an "only under XP" issue. I should have probably tested it under XP as well as under Vista.
I am going to create a support case on your behalf.
-Alex
Hey Alex,
Thanks for the suggestion - that style appears to be exactly what I want - however, it's doing strange things....
...so, I've updated my demo app (please find attached).
Without the style, you can apply groupings and everything appears ok:
I've added your style to "Doc1.xaml", for the "department" field (it programatically groups by this field when loaded). The idea being we want to force the department grouping, users should be able to apply additional groupings on top of this one, but they should not be able to remove the department grouping at all.
The style does have the effect of hiding the "department" LabelPresenter when in the group by area, but it also has a couple of strange side effects. The style of any additional LabelPresenters in the group by area loose their background and the style of all the standard LabelPresenters in the header row get messed up:
I'm really not sure what's going on here as that style should surely only be affecting the department field!?
Hey Dave,
How about this:
<Style TargetType="{x:Type igDP:LabelPresenter}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsInGroupByArea, RelativeSource={RelativeSource Self}}" Value="True"/>
<Condition Binding="{Binding Field.Name, RelativeSource={RelativeSource Self}}" Value="Name"/>
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="Visibility" Value="Collapsed"/>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</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,