This question is locked. New answers and comments are not allowed.
HI,I would like change the cell background,so I used CellLoaded and RowLoaded.
but have a issue,the CellLoaded can't change the cell background(RowLoaded can work ).
I don't what happen.
RowLoaded Event
CellLoaded Event
btw:I also try used StyleSelector,but it can't
thanks.
rever.
but have a issue,the CellLoaded can't change the cell background(RowLoaded can work ).
I don't what happen.
RowLoaded Event
for (int i = 0; i < e.Row.Cells.Count; i++){ GridViewCell mark = e.Row.Cells[i] as GridViewCell; string markValue = mark.Value as string; if (markValue != null) { List<string> TEST = new List<string>(); string[] t = markValue.Split(','); foreach (string item1 in t) { if (item1 == "NE") { e.Row.Cells[i].Background = new SolidColorBrush(Colors.LightGray); } } }}void RgvVerify_CellLoaded(object sender, CellEventArgs e) { GridViewCell mark = e.Cell as GridViewCell; if (mark != null) { string markValue = mark.Value as string; if (markValue != null) { List<string> TEST = new List<string>(); string[] t = markValue.Split(','); foreach (string item1 in t) { if (item1 == "NE") { mark.Background = new SolidColorBrush(Colors.Green); } } } } }btw:I also try used StyleSelector,but it can't
thanks.
rever.