0
votes

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.

1

1 Answers

0
votes

From:How To Dynamically Format Columns For A Detail View

Columns are already created, when the MasterRowExpanded event occurs. Please try to use this event to customize them as you require, and let me know whether this solution meets your needs.

Refer these DevExpress threads:
Style conditions conditional formatting for master and detail views
How to set row style of Detail grid records after data binded to xtragrid master-detail data Master/Detail grid with StyleFormatCondition