假设我有一个对象
public int Id { get; set; }
public int EmployeeId { get; set; }
public Employee Employee { get; set; }
public String Note { get; set; }
我有以下代码将其绑定到datagrid:
DataGrid.ItemsSource = _db.Notes.ToList().OrderBy(d => d.EmployeeId);
是否可以使用数据网格的AlternatingRowBackground="" AlternationCount=""
来基于EmployeeId
设置行颜色交替?