I am new to Silverlight and infragistics, we are in requirement to show background color of the column as red if the data is null for text column or Template columns but we don't know how to make the background color dynamically based on the cell value. the cell value can be text or number.
Thanks in Advance for your help.
kindly contact me if the description is not clear.
Hello ,
In order to change the background color of a cell in the XamGrid whenever it's value is null, you can handle the CellExitedEditMode event of the control by checking the Value of the cell explicitly and setting the Background property of the respective CellContro to Red.
private void xamGrid_CellExitedEditMode(object sender, CellExitedEditingEventArgs e){ var cell = e.Cell; if (string.IsNullOrEmpty(cell.Value as string)) cell.Control.Background = new SolidColorBrush(Colors.Red); else cell.Control.Background = new SolidColorBrush(Colors.Transparent);}
if (string.IsNullOrEmpty(cell.Value as string)) cell.Control.Background = new SolidColorBrush(Colors.Red); else cell.Control.Background = new SolidColorBrush(Colors.Transparent);}
I have attached a sample that demonstrated the behavior from above.
If you require any further assistance on the matter, please let me know.