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
1915
CellValuePresenter style hides cell border?
posted

I am defining the following CellValuePresenter style

<Style x:Key="CellColorStyle" TargetType="{x:Type igWPF:CellValuePresenter}">
<!-- Template combines icon set by a separate converter and Text into the same cell -->

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igWPF:CellValuePresenter}">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value, Converter={StaticResource StatusIconConverter}}" Width="16" Height="16" Margin="5" />
<TextBlock VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type igWPF:CellValuePresenter}}, Path=Value}"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>

<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="2,0,2,0"/>
</Style>

Style is set for one of the Fields in the grid. For whatever reason the column separators between this cells in that column and the adjacent column have gone missing. I attempted to explicitely add the BorderBrush and Borderthickness but these have not helped. Any idea how to restore the separators? Thanks.

  • 16495
    Offline posted

    Hello Andre,

     

    Thank you for your post.

     

    I have been looking into your question and the reason for the missing separator is that you are overriding the default template of the CellValuePresenter. In order to avoid this appearance, you can use ContentTemplate instead. I have created short sample project that show how you can implement my suggestion.

     

    Please let me know if you require any further assistance regarding this matter.

    Separator.zip