c# - Cell color of WPF DataGrid back to the default -


I am using buildin WPF DataGrid using .NET 4.

I can do a set of backgrounds like the DataGridCell Programmers below.

  DataGridCell dgc = this.GetCell (i, j); // GetCell's extension is func dgc.Background = Brushes.LightGray;  

My question is, how can I set the background color and return it to the default? By "default" I mean that if the cell is selected, the default transparent background with blue color. If I just set the cell background back to the bottom,

  dgc.Background = Brushes.Transparent;  

Then, this auction is not created when it is chosen.

dgc.ClearValue (DataGridCell.BackgroundProperty);

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -