Hi All,
In my project I have requirement to render xamdatagrid with dotted grid lines. I decided to research on this and came up with following solution.
1) Retemplate CellVaue presenter 2) Use canvas layout with right dotted line, bottom dotted line and cell value
I have attached file for your reference.
Let me know if you have better solution.
Thanks & Regards,Ajosh
That is an excellent solution.
Thanks,
Ajosh
In that case, you can use two separate rectangles - one stretching on the bottom and one stretching on the left side of the cell.
<Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Right"
Stroke="Black" StrokeDashArray="1,2"/>
<Rectangle VerticalAlignment="Bottom" HorizontalAlignment="Stretch"
I tried using Rectangle, but the problem is, the inner grid lines are getting thicker.
Hello Ajosh,
You can easily achieve this by putting an extra rectangle element inside the default control template of the CellValuePresenter with a DashStrokeArray, like this:
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<igWindows:CardPanel>
<Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Stroke="Black" StrokeDashArray="1,2" />
....
</Setter>
Note that by keeping the rest of the template intact, you will not lose any other functionalities, like editing using your approach. I have modified and attached your solution back to this forum thread.