Exception encountered: The 'ThemeManager.RegisterGroupings' method must be used to register the groupings for elements of type 'Infragistics.Windows.DataPresenter.HeaderLabelArea' or one of its base classes to indicate the theme groupings that should be applied when the 'Theme' property is set.
This is the only change I've made:
<Style x:Key="DataGridStyle">
<Setter Property="igDP:XamDataGrid.Theme" Value="Aero" />
</Style>
I assume I'm doing it wrong, but what am I doing wrong and how do I do it right?
My bad, I must have had an artifact still hanging around that was hosing things. I reverted my changes, started over in following the instructions for using a theme and it works correctly. Thanks again for your help.
I've also removed the Style setting and replaced it with a direct set of the Theme on the control with no change.
<igDP:XamDataGrid x:Name="grdTest" IsGroupByAreaExpanded="False" Grid.Row="0" Theme="Aero">
Thanks for the explanation and the quick reply.
I'm explicitly setting the style property on my XamDataGrid, but maybe there's something about that definition that is complicating things, possibly AllowGroupBy? Here's the markup:
<igDP:XamDataGrid x:Name="grdTest" IsGroupByAreaExpanded="False" Grid.Row="0" Style="{DynamicResource DataGridStyle}">
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings AllowGroupBy="True" AllowEdit="False" AllowCellVirtualization="True" CellClickAction="SelectRecord" LabelClickAction="SortByMultipleFields" LabelTextTrimming="CharacterEllipsis" />
</igDP:XamDataGrid.FieldSettings>
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False" MaxSelectedRecords="1" />
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>...</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Basically you cannot set the Theme property in a Style unless you're explicitly setting the Style property or adding it to that element's Resources (and nothing higher in the ancestor chain including the application resources). Really this property is meant to be set using a local setting on a control. The reason is that when you set the Theme (e.g. on a xamDataGrid), the ThemeManager is adding the ResourceDictionaries registered for that Theme to that control's Resources. So let's say you put the above style (without the key in the application's resources). The above style would be the local style. When that style was applied, it would set the Theme to Aero. When the Theme is set to Aero, the aero resources would be put into the Resources of the xamDataGrid. Since that theme includes a style for the xamDataGrid and that style is closer in the resource chain, WPF would make that style the local style (since WPF only has 1 local style). When WPF removed the first style, it would undo the setter for the Theme property which would remove the Aero resources from the xamDataGrid so it would no longer use the Aero defined xamDataGrid style and would end up picking up application style again starting the process all over. From the error it doesn't sound like this is your issue but I thought it was important to mention it. I'm not sure where you are using that "DataGridStyle" keyed style but the Theme property can only be set on certain elements (e.g. xamData(Grid|Carousel|Presenter), xamRibbon, etc.) - elements who have registered the groupings (e.g. primitives, editors, datapresenter) that that element would use. Unless you're defining your own elements and registering themes with our thememanager, you wouldn't be setting the Theme property on any other element. From the error message it sounds like you're using that DataGridStyle explicitly or as a based on for a style for the HeaderLabelArea.