Hi Johnes,
Thanks for contacting Syncfusion support.
We would like to let you know that you can achieve your requirement by using CellStyleSelecto. We have prepared a sample to replicate this scenario and it is available in the following link for your reference.
Code example :
|
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.dataGrid.CellStyleSelector = new CustomRowStyleSelector();
}
}
public class CustomRowStyleSelector : StyleSelector
{
public override Style SelectStyle(object item, DependencyObject container)
{
if((container as GridCell).ColumnBase.RowIndex == 2)
{
Style style = new Style(typeof(GridCell));
style.Setters.Add(new Setter(GridCell.BackgroundProperty, Brushes.Green));
return style;
}
return base.SelectStyle(item, container);
}
} |
Please have a look at this sample and let us know if you require any other assistance from us.
Regards,
Mohanram A.