Home > Net >  Click the DataGrid control in WPF any line don't change the color to do
Click the DataGrid control in WPF any line don't change the color to do

Time:09-15

Click the DataGrid control in WPF line don't change any colors do

The diagram below, the above three rows of green and the following are a DataGrid,
Click with the mouse click any cell, the cell color will always be changed,
My demand is not to change color, the selected cell
Such as when you click on col 2 row 3 cell or green color, how to do?

Know to inform the grateful,



CodePudding user response:

With the Grid is not good, can also merge table cell,

CodePudding user response:

Same, and change the style of the DataGrid, such as you to set up the selected background or foreground,

 
& lt; The DataGrid. CellStyle>
& lt; Style TargetType="DataGridCell" & gt;
& lt; Style. Triggers>
& lt; The Trigger Property="an IsSelected" Value="https://bbs.csdn.net/topics/True" & gt;
& lt; Setter Property="Background" Value="https://bbs.csdn.net/topics/White"/& gt;
& lt; Setter Property="Foreground" Value="https://bbs.csdn.net/topics/Black"/& gt;
& lt; Setter Property="BorderThickness" Value="https://bbs.csdn.net/topics/0"/& gt;
& lt;/Trigger>
& lt;/Style. Triggers>
& lt;/Style>
& lt;/the DataGrid. CellStyle>
  •  Tags:  
  • C#
  • Related