Hi,
I am trying to create a style for a custom control which inherits XamDataGrid. There are no actual alterations between my custom control and XamDataGrid.
The following code is placed inside Themes/generic.xaml:
<Style x:Key="{x:Type local:MyXDG}" BasedOn="{StaticResource {x:Type igDP:XamDataGrid}}" TargetType="{x:Type local:MyXDG}" >
<Setter Property="ScrollingMode" Value="DeferredWithScrollTips"/>
<Setter Property="Theme" Value="Office2k7Black"/>
<Setter Property="Margin" Value="0,56,0,0"/>
<!-- The Above 3 Properties work -->
<Setter Property="FieldLayoutSettings">
<Setter.Value>
<igDP:FieldLayoutSettings HighlightAlternateRecords="True"/>
</Setter.Value>
</Setter>
<igDP:FieldLayoutSettings AllowDelete="False"/>
</Style>
The issue I am having is to do with the two separate <Setter Property="FieldLayoutSettings"> tags. The lower tag always seems to be the only change made of the two.
In the above example the AllowDelete works but not the HighlightAlternateRecords. If I was to place the HighlightAlternateRecords beneath the AllowDelete than the HighlightAlternateRecords would work but not the AllowDelete.
What I was wondering is if there was a way to declare Nested Setter Properties (like FieldLayoutSettings.Whatever) so they do not overwrite each other.
Thanks
In short I would like find out how to use multiple igDP:FieldLayoutSettings with this following code found here :
<Style TargetType="{x:Type igDP:XamDataGrid}">
<igDP:FieldLayoutSettings AllowFieldMoving="No"/>
Hello,
I would recommend inheriting the XamDataGrid and setting these properties in its initialized/loaded event.