Home Forums WinForms controls Xceed Grid for WinForms How do I access the ColumnManagerRow?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16627 |

    Hi

    I am trying to set the ‘Background’ property on the ColumnManagerRow. How do I get hold of an instance of this class in order to set the property?

    Thanks

    Nick

    Imported from legacy forums. Posted by Nick (had 1989 views)

    User (Old forums)
    Member
    Post count: 23064

    Prove this :

    ColumnManagerRow

    managerRow = new ColumnManagerRow();
    managerRow.BackColor =
    Color.White;

    this.gridControl1.FixedHeaderRows.Remove(this.gridControl1.FixedHeaderRows[0]);
    gridControl1.FixedHeaderRows.Add(managerRow);

    But , this works only when the UIStyle is set to System or WindowsClassic. I know that this is not a manner get hold the instance of this class, but at least it work. I hope this is useful for you
    Edi

    Imported from legacy forums. Posted by Edi (had 420 views)

    User (Old forums)
    Member
    Post count: 23064

    There is a better solution :

    this.gridControl1.FixedHeaderRows[0].BackColor = Color.White;

    Imported from legacy forums. Posted by Edi (had 404 views)

    User (Old forums)
    Member
    Post count: 23064

    If you drop the GridControl in the designer, this will be the second row in the FixedHeaderRows collection, the first being the GroupByRow.  You can access it through the variable created by the designer or as shown above, by the FixedHeaderRows collection.

    e.g.:

    columnManagerRow1.BackColor = Color.Blue;

    or

    ColumnManagerRow colManager = gridControl1.FixedHeaderRows[ 1 ] as ColumnManagerRow;

    colManager.BackColor = Color.Blue;

     

    If you want this to work, whatever theme is selected for the grid (through the UIStyle property), set the OverrideUIStyle property to true.

    e.g.;

    columnManagerRow1.OverrideUIStyle = true;

    columnManagerRow1.BackColor = Color.Blue;

     

    Imported from legacy forums. Posted by André (had 815 views)

    User (Old forums)
    Member
    Post count: 23064

    Is there a new way to do this because FixedHeaderRows no longer appears to be a property of the DataGridControl, unless I need to reference additional assemblies to do this?  If so, which one(s).

     

    Thanks

     

    Imported from legacy forums. Posted by France (had 267 views)

    User (Old forums)
    Member
    Post count: 23064

     

    Imported from legacy forums. Posted by France (had 1464 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.