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
285
Change specific Column Headers style
posted

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

Parents
  • 54937
    Verified Answer
    Offline posted

    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:XamDataGrid >

        <igDP:XamDataGrid.Resources>

            <Style x:Key="italicLabel" TargetType="{x:Type igDP:LabelPresenter}">

                <Setter Property="FontStyle" Value="Italic" />

            </Style>

        </igDP:XamDataGrid.Resources>

        <igDP:XamDataGrid.FieldLayouts>

            <igDP:FieldLayout>

                <igDP:FieldLayout.Fields>

                    <igDP:Field Name="MyFieldName">

                        <igDP:Field.Settings>

                            <igDP:FieldSettings LabelPresenterStyle="{StaticResource italicLabel}" />

                        </igDP:Field.Settings>

                    </igDP:Field>

                </igDP:FieldLayout.Fields>

            </igDP:FieldLayout>

        </igDP:XamDataGrid.FieldLayouts>

    </igDP:XamDataGrid>

Reply Children