I found an example in the documentation on how to change the column headers style. It suggests creating a style with LabelPresenter as the target type and ommitting a key so that it is applied to all column headers. I need to change the style on just a few headers. Is there a way I can assign a header style per column?
Thanks for your help,
Mike
Your defining each field in a different field layout. A record is only associated with a single fieldlayout so if your underlying data has all 3 fields then you should define the fields in a single fieldlayout.
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="MyFieldName1"/>
<igDP:Field Name="MyFieldName2"/>
<igDP:Field Name="MyFieldName3"/>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
Many thanks, that's percisely what I was looking for.
But for some reason I cannot get multiple FieldLayout to show up -- on the first one shows up. In the example below, only MyFieldName1 shows up (MyFieldName2 & 3 are missing). Any ideas why that might happen?
<igDP:XamDataGrid >
<igDP:XamDataGrid.Resources>
<Style x:Key="italicLabel" TargetType="{x:Type igDP:LabelPresenter}">
<Setter Property="FontStyle" Value="Italic" />
</Style>
</igDP:XamDataGrid.Resources>
</igDP:XamDataGrid>
You can set the LabelPresenterStyle on a FieldSettings instance. The FieldSettings class is exposed from the Field (via its Settings property), on the FieldLayout (via its FieldSettings property) and on the control (via its FieldSettings property).
<igDP:Field Name="MyFieldName">
<igDP:Field.Settings>
<igDP:FieldSettings LabelPresenterStyle="{StaticResource italicLabel}" />
</igDP:Field.Settings>
</igDP:Field>