You can use a DataGrid Style Selector
to accomplish this. In that documentation, you'll find an example class named MyCellContentStyleSelector
. It's this class that picks a particular template for the cell based on a value of the bound data object for that row.
From what you described your scenario to be, the logic would look something like this:
DataGridCellInfo cellInfo = item
var bom = cellInfo.Item
(bom.TotalQty == bom.Quantity)
One thing to keep in mind is that you'll want to think about this as cell styling, not row styling. So if you want the entire row's cells to use that same coloring, you can assign that same Style Selector for each column.
Side Note: If you expect the values to change in real time after
they've been rendered (e.g. through property changed notifications), then you'll want to use an IValueConverter or Xamarin DataTrigger in the CellTemplate instead of a Style Selector.
Lance | Technical Support Engineer, Principal
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items