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
210
Change the background/foreground colour for a given column heading, in XAML
posted

I have a xamDatagrid which allows the user to key into 3 our of 12 columns.  I would like to highlight the columns they can key into by changing the background/foreground of the column heading.

I would also like whatever they key to be shown in bold.

How do I specify this in XAML ?

Parents
  • 1500
    Offline posted

    Hello Gordon,

    Thank you for reaching out.

    You can style the LabelPresenter with a DataTrigger on the key or the property identifying the field can be entered by the user. Here is an example how to bind to the Tag property of a Field:

    <Style TargetType="{x:Type igDP:LabelPresenter}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=Field.Tag, RelativeSource={RelativeSource Self}}" Value="Key">
                            <Setter Property="Foreground" Value="Yellow"/>
                            <Setter Property="Background" Value="Red"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>

    However, I don't understand what you mean by key(there is no key property of the Field class, but if you give me some more details, I will be happy to help you.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics

Reply Children