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 ?
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 TonevAssociate Software DeveloperInfragistics
Here is a snipped of the XAML defining some of my columns
<ig:Field Label="List Price" IsTabStop="False" AlternateBinding="{Binding Price}" HorizontalContentAlignment="Right"> <ig:Field.Settings> <ig:FieldSettings AllowHiding="Default" AllowEdit="False" Width="100" /> </ig:Field.Settings> </ig:Field>
<ig:Field Label="Discount" IsTabStop="False" AlternateBinding="{Binding Discountrate, Mode=TwoWay}" HorizontalContentAlignment="Right"> <ig:Field.Settings> <ig:FieldSettings AllowHiding="Default" AllowEdit="False" Width="80" /> </ig:Field.Settings> </ig:Field>
<ig:Field Label="Cases" AlternateBinding="{Binding Casesordered, Mode=TwoWay}" Format="##,###" HorizontalContentAlignment="Right" > <ig:Field.Settings> <ig:FieldSettings AllowHiding="Default" AllowEdit="True" Width="80" /> </ig:Field.Settings> </ig:Field>
<ig:Field Label="Units" AlternateBinding="{Binding Unitsordered, Mode=TwoWay}" Format="##,###" HorizontalContentAlignment="Right"> <ig:Field.Settings> <ig:FieldSettings AllowHiding="Default" AllowEdit="True" Width="80" /> </ig:Field.Settings> </ig:Field>
I am allowing them to edit data in 2 of the columns - cases and units. I want t o be able to change the column heading for these columns to make them stand out, and show the contents of the these columns in bold or a slightly bigger font size to make them stand out