Hi, I have to add a color to particular rows of DevExpress gridview. There is an event RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e). It works fine but if I sort the data, good indexes are lost. How to solve this problem? How to access the sorted data because I only can access datasource. Thank you. Here is the code that works only with not sorted data:
private void dataGridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
{
try
{
if ((int)((DataTable)gridControl1.DataSource).Rows[e.RowHandle]["Lating"] > 0)
{
e.Appearance.BackColor = Color.Red;
}
}
catch
{
}
}