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
3166
CellValuePresenterStyle StrikeThrough
posted

I tried to used the style as mentioned in this post http://es.infragistics.com/community/forums/p/51185/268258.aspx

However instead of using the EditorStyle (Editor) I defined the CellValuePresenterStyle. The reason for this was I already have CellValuePresenterStyle for Border related properties. Do I need to define both the EditorStyle and CellValuePresenterStyle.

In the following example 'name' is using EditorStyle and works. While 'department' is using CellValuePresenterStyle' and does NOT work.

<igDP:XamDataGrid BindToSampleData="True">
<igDP:XamDataGrid.Resources>
<Style x:Key="StrikeThroughEditor"
TargetType="{x:Type editors:XamTextEditor}"
BasedOn="{StaticResource {x:Type editors:XamTextEditor}}">
<Style.Resources>
<Style TargetType="{x:Type controls:SimpleTextBlock}">
<Setter Property="TextDecorations" Value="Strikethrough" />
</Style>
</Style.Resources>
</Style>

<Style x:Key="StrikeThroughCellValuePresenter"
TargetType="{x:Type igDP:CellValuePresenter}"
BasedOn="{StaticResource {x:Type igDP:CellValuePresenter}}">
<Style.Resources>
<Style TargetType="{x:Type controls:SimpleTextBlock}">
<Setter Property="TextDecorations" Value="Strikethrough"/>
</Style>
</Style.Resources>
</Style>
</igDP:XamDataGrid.Resources>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:Field Name="name">
<igDP:Field.Settings>
<igDP:FieldSettings EditorStyle="{StaticResource StrikeThroughEditor}" />
</igDP:Field.Settings>
</igDP:Field>

<igDP:Field Name="department">
<igDP:Field.Settings>
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource StrikeThroughCellValuePresenter}" />
</igDP:Field.Settings>
</igDP:Field>

</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>