void Page_PrepareCellDisplayElement(object sender, PrepareCellDisplayElementEventArgs e) { Order order = (Order)e.DisplayElement.DataContext; TextEdit editor = (TextEdit)e.DisplayElement; if (order.Price > 200) { editor.Foreground = new SolidColorBrush(Colors.Red); } }
private void unitPriceColumn_PrepareCellDisplayElement(object sender, PrepareCellDisplayElementEventArgs e) { if ((double)e.CellData > 20) { ((TextEdit)e.DisplayElement).Foreground = new SolidColorBrush(Colors.Red); ((TextEdit)e.DisplayElement).Background = new SolidColorBrush(Colors.Yellow); ((TextEdit)e.DisplayElement).FontWeight = FontWeights.Bold; } }