I want to changing my gridview's master detail rows style according to some conditoion. My code like this ;
GridView newDetailView = grdLog.CreateView("GridView") as GridView;
GridView View = sender as GridView;
gvLog.MasterRowGetLevelDefaultView += (s, e2) =>
{
if (e.RowHandle >= 0)
{
for (int i = 0; i < gvLog.Columns.Count - 15; i++)
{
string strTimeKey1 = View.GetRowCellDisplayText(e.RowHandle, View.Columns[i]);
string strTimeKey2 = View.GetRowCellDisplayText(View.FocusedRowHandle, View.Columns[i]);
if (!strTimeKey1.Equals(strTimeKey2))
{
e.Appearance.BackColor = Color.Red;
}
}
}
};
My parent row and detail row have same columns , It must be like If detail row' column value is different from parent row's column value , cell color will be red.