Note that there are some explanatory texts on larger screens.

plurals
  1. PODotted Horizontal Grid Lines in WPF DataGrid
    primarykey
    data
    text
    <p>Is there a way to have a dotted line on the horizontal grid lines in WPF datagrid? I have googled everywhere and cannot seem to find a concrete way of doing so. One solution that may solve this is setting the Datagrid.RowStyle. I have tried this and it causes error. I have binded my datagrid to a datatable. 2 columns are just text and the 3rd one is an image column. For this columns, I used DataGridTemplateColumn. Textblock and Image. I hope you can help me guys...If you want a sample of my code here it is.</p> <pre><code> &lt;StackPanel&gt; &lt;dg:DataGrid Name="questionList" HeadersVisibility="None" AutoGenerateColumns="False" Background="White" Margin="42,32,43,0" BorderThickness="0" GridLinesVisibility="Horizontal" CanUserAddRows="False" HorizontalGridLinesBrush="#FFCCCCCC" MaxHeight="549" Cursor="Hand" PreviewMouseLeftButtonUp="questionnaireList_PreviewMouseLeftButtonUp"&gt; &lt;dg:DataGrid.CellStyle&gt; &lt;Style TargetType="{x:Type dg:DataGridCell}"&gt; &lt;Setter Property="BorderThickness" Value="0"/&gt; &lt;/Style&gt; &lt;/dg:DataGrid.CellStyle&gt; &lt;dg:DataGrid.RowStyle&gt; &lt;Style TargetType="{x:Type dg:DataGridRow}"&gt; &lt;Setter Property="Background" Value="{Binding MyImage, Converter={x:Static my:StatusColorConverter.instance}}" /&gt; &lt;/Style&gt; &lt;/dg:DataGrid.RowStyle&gt; &lt;dg:DataGrid.Columns&gt; &lt;dg:DataGridTemplateColumn Width="69*"&gt; &lt;dg:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock Margin="12,16,0,17" FontSize="18" Foreground="#0891F1" Text="{Binding Path=Number}" TextWrapping="Wrap"/&gt; &lt;/DataTemplate&gt; &lt;/dg:DataGridTemplateColumn.CellTemplate&gt; &lt;/dg:DataGridTemplateColumn&gt; &lt;dg:DataGridTemplateColumn Width="601*"&gt; &lt;dg:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBlock FontSize="16" Foreground="#666666" Text="{Binding Path=Desc}" TextWrapping="Wrap" TextAlignment="Justify" Margin="0,16,0,17" /&gt; &lt;/DataTemplate&gt; &lt;/dg:DataGridTemplateColumn.CellTemplate&gt; &lt;/dg:DataGridTemplateColumn&gt; &lt;dg:DataGridTemplateColumn Width="117*"&gt; &lt;dg:DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;Image Source="{Binding Path=Imgs}" Stretch="None" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,16,18,17" /&gt; &lt;/DataTemplate&gt; &lt;/dg:DataGridTemplateColumn.CellTemplate&gt; &lt;/dg:DataGridTemplateColumn&gt; &lt;/dg:DataGrid.Columns&gt; &lt;/dg:DataGrid&gt; &lt;/StackPanel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload