DataGrid: How to remove black inner borders?

I have a datagrid:

<DataGrid x:Name="gvImports" HorizontalAlignment="Left" AutoGenerateColumns="False" Margin="10,36.816,0,0" VerticalAlignment="Top" Height="163.087" Width="485.05"> </DataGrid> 

Then I set the cell border style in C #:

 var cellStyle = new Style(typeof(DataGridCell)); cellStyle.Setters.Add (new Setter(DataGridCell.BorderBrushProperty, Brushes.Magenta)); gvImports.CellStyle = cellStyle; 

Note the offensive Magenta for demo purposes only.

Here is an image of a DataGrid when rendering:

enter image description here

I want to get rid of these inner black lines, any idea how this is done?

+4
source share
2 answers
 gvImports.GridLinesVisibility = DataGridGridLinesVisibility.None; 
+6
source

Set the horizontal and vertical grid brushes ( HorizontalGridLinesBrush and VerticalGridLinesBrush ). See here for data grid style properties.

0
source

Source: https://habr.com/ru/post/1492796/


All Articles