Silverlight DataGrid 행의 색을 어떻게 변경합니까?C# Silverlight Datagrid - 행 색 변경
나는이 시도했다 그러나 나는 그것이 ... 임의의 행 색 잘못 얻을하는 방법을 작동하지 않습니다
void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e)
{
var c = e.Row.DataContext as Job;
if (c != null && c.Status.Contains("complete"))
e.Row.Background = new SolidColorBrush(Colors.Green);
else
e.Row.Background = new SolidColorBrush(Colors.Red);
}
이 코드와 그것의 가능한 무작위 색깔하려면 행을 생각하지 않는다 -하지만 당신은 항상 배경색을 설정하지 않은 경우 가능 -이 당신을 위해 작동하는 경우 –