I am using a ComponentOne DataTree that is a FlexGrid with child grids. The parent grid has 2 columns a 'Select' column which is a checkbox and another column that is read-only. The child grid has 5 columns. The first is a checkbox and the other 4 are readonly. The read-only columns appear gray by default. I set the DataTable columns that is the data source of the grids to ReadOnly. I want the non-header columns to have a background of white by default. Neither grid is updated.
I define the style as a member variable and create the style in the Initialize method:
C1.Win.C1FlexGrid.CellStyle defaultRowStyle;
private void InitializeControls()
{
txtWorkZone.Enabled = true;
txtWorkZone.Focus();
defaultRowStyle = c1flxdatatreeCasePick.Styles.Add("DefaultRowStyle");
defaultRowStyle.BackColor = Color.White;
}
This is the OwnerDrawCell method that sets it:
private void c1flxdatatreeCasePick_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
{
C1FlexDataTree grid = sender as C1FlexDataTree;
if (grid == null || grid.DataSource == null)
return;
if(e.Row > 0)
grid.Rows[e.Row].Style = grid.Styles["DefaultRowStyle"];
//Get the child grid
C1FlexDataTree childGrid = grid.Rows[e.Row].UserData as C1FlexDataTree;
if (childGrid != null)
{
if(e.Row > 0)
childGrid.Rows[e.Row].Style = grid.Styles["DefaultRowStyle"];
}
}
Why won't the grids get the row style setting?
Thanks Gloria