Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
Different LabelPresenter between XamDataGrid and FieldChooser
posted

Hi,

I try to define different labelpresenter styles between Xamdatagrid and FieldChooser.

I definde those two styles:

    <Style TargetType="{x:Type igDP:LabelPresenter}">
        <Setter Property="Background" Value="#FF000000"/>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
        <Setter Property="LabelHighlight" Value="{StaticResource LabelHLight}"/>
        <Setter Property="FontFamily" Value="Calibri"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
     </Style>

    <Style x:Key="forFieldChooser" TargetType="{x:Type igDP:LabelPresenter}">
        <Setter Property="Background" Value="#FFFFFFFF"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="LabelHighlight" Value="{StaticResource LabelHLight}"/>
        <Setter Property="FontFamily" Value="Calibri"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
    </Style>

I did not find how to apply the second one to the fieldchooser so i tried to define it as default (by removing the keyword "x:key=forFieldChooser"), and renamed the first one "forHeader" then I  applied it to my datagridthis way:

<igDP:XamDataGrid.FieldSettings>
                <igDP:FieldSettings LabelPresenterStyle={DynamicResource forHeader}/>
</igDP:XamDataGrid.FieldSettings>

It worked fine for the headr but the fieldchooser also took this style instead of default.

Is there anyway to use different styles between Fieldchooser and Datagrid's headers?