Hello
Could please help me with that?
See my attached project.
Editor template styles issue.zip
Nice, thank you:)
Hi Vasily,
That style isn't getting applied because the XamGrid is trying to apply the column's EditorStyle to the root element in the DataTemplate which happens to be the TextBox. There are two options here:
1.) You can move your style to the column's EditorStyle property
<ig:TemplateColumn.EditorTemplate> <DataTemplate> <TextBox x:Name="TextBox"/> </DataTemplate> </ig:TemplateColumn.EditorTemplate> <ig:TemplateColumn.EditorStyle> <Style TargetType="TextBox"> <Setter Property="Text" Value="Hello"/> </Style> </ig:TemplateColumn.EditorStyle>
2.) You can place the TextBox into a Grid element so the XamGrid can't override your style
<ig:TemplateColumn.EditorTemplate> <DataTemplate> <Grid> <TextBox x:Name="TextBox"> <TextBox.Style> <Style TargetType="TextBox"> <Setter Property="Text" Value="Hello"/> </Style> </TextBox.Style> </TextBox> </Grid> </DataTemplate> </ig:TemplateColumn.EditorTemplate>