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
210
Show Grid Lines on xamDataGrid
posted

I have templated the cell value with my own control. Need to show grid lines for all of the grid cells? I tried to give border thickness and BorderBrush as suggested in another post. Did not work, suggestions

<Style TargetType="{x:Type ig:CellValuePresenter}">

   <Setter Property="BorderThickness" Value="0,0,1,1"/>

   <Setter Property="BorderBrush" Value="Black"/>

<Setter Property="Template">
<Setter.Value>
<ControlTemplate>

<TextBlock/>

</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

  • 138253
    Verified Answer
    Offline posted

    Hello Jasvinder, 

    Thank you for your post. I have been looking into it and I can suggest you use the following Style instead of yours:

    <Style TargetType="{x:Type igDP:CellValuePresenter}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Border BorderBrush="Black" BorderThickness="0,0,1,1">
                    <TextBlock/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    Because when you set the Template of a Control you lose all of its built-in functionality. 

    Hope this helps you.