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
1865
XamTextEditor Style - based on column name?
posted

For a xamDataGrid, I currently have AutoGenerateFields = False and for the field ProcessDate I am using:

<igDP:FieldSettings EditorStyle="{StaticResource ResourceKey=DateStyle}" >igDP:FieldSettings>

 

The style DateStyle is defined in a Resource file that is referenced in ResourceDictionary section of the xamDataGrid:

<ResourceDictionary Source="../Resource/ResourceTextStyles.xaml" />

 

In the above resource file, I have:

 <Style x:Key="DateStyle" TargetType="{x:Type igEditors:XamTextEditor}">

 <Style.Setters>

 <Setter Property="Format" Value="MMM-dd-yyyy"/>

Style.Setters>

 Style>

 Now, I want to have AutoGenerateFields = True. I want to say - if a column name = "ProcessDate", format the data in the field as MMM-dd-yyyy. and have this in a resource file which is referenced in the xaml - How do I do this?

 The following is not working:

  <Style TargetType="{x:Type igEditors:XamTextEditor}">

 <Style.Triggers>

 <DataTrigger Binding="{Binding Path=Field.Name, RelativeSource={RelativeSource Self}}" Value="ProcessDate">

<Setter Property="Format" Value="MMM-dd-yyyy"/>

DataTrigger>

Style.Triggers>

Style>