0
votes

enter image description hereWe want to set padding in a WPF datagrid which is done as follows. However when we select a particular row, white space appears between the cells of the selected row. How can we give padding and also make the white space disppear on datagrid row selection.

<Style TargetType="DataGridCell">
  <Setter Property="Padding" Value="2 0 2 0"/>
</Style>
1
What white space? Can you post the snapshot for the same? - Rohit Vats

1 Answers

0
votes

Set the Background to Transparent if your control background and window background is same. Or Set DataGridCell template with TextBlock and set the padding to the TextBlock and set the background of the TextBlock same as that of DataGrid