Hello, i my grid i will underline some values within the grid. Which property is responsible to underline the value of the CellValuePresenter ?
Hello,
I have been looking into your requirement and at the workaround you have provided. Although this would show the Underlines in your XamDataGrid’s cells it will terminate too much functionality. Actually you can see the original template for the CellValuePresenter in the DefaultStyles folder and see it has much more functionality.
In order to preserve all your functionality in the grid’s cells and have underlined text in both inside and outside EditMode I can suggest you create a style for the XamEditor that used in your specific Field. E.g. if you have a string column you set Field.Settings.EditorStyle to a style like this one:
<Style TargetType="{x:Type igEditors:XamTextEditor}" x:Key="underlined">
<Style.Resources>
<Style TargetType="{x:Type igWindows:SimpleTextBlock}">
<Setter Property="TextDecorations" Value="Underline" />
</Style>
<Style TargetType="TextBox" >
<Setter Property="TextDecorations" >
<Setter.Value>
<TextDecorationCollection >
<TextDecoration />
</TextDecorationCollection>
</Setter.Value>
</Setter>
</Style.Resources>
and if you have a decimal column you can use the same style by just setting its TargetType property:
<Style TargetType="{x:Type igEditors:XamCurrencyEditor}" >
… the same contents here…
Please let me know if this is what you needed and if you require any further clarification on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Solution:
<Style x:Key="underlineValuePresenter" TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}"> <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Left" TextDecorations="Underline" Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Value, StringFormat={}{0:F2}}" /> </ControlTemplate> </Setter.Value> </Setter> </Style>or