Say I have a very simple WPF grid (6 rows x 6 columns) defined as follows:
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
I want the following grid lines (one solid line and two dashed lines) drawn as follows (I drew this in Excel so ignore the light Excel grid lines):

How might I go about doing this in XAML?
You can place
Lines at the tops of the required cells, by settingVerticalAlignment="Top", the appropriateGrid.ColumnSpan, and setStrokeDashArrayto get the dashed line.Edit: The above was just off the top of my head, and I apparently forgot about a few ‘features’ of WPF.
Here is the sample I got working. I put it in a Grid with 5 rows and columns, star-sized.
Note: If rows will vary in size, that won’t work, since it centers the line in the two rows. If they will vary in size, you will need
VerticalAlignment="Top", but beware, the top half of the line will be clipped.