Home › Forums › WinForms controls › Xceed Grid for WinForms › How do I access the ColumnManagerRow?
-
AuthorPosts
-
#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)
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
EdiImported from legacy forums. Posted by Edi (had 420 views)
There is a better solution :
this.gridControl1.FixedHeaderRows[0].BackColor = Color.White;
Imported from legacy forums. Posted by Edi (had 404 views)
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)
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)
Imported from legacy forums. Posted by France (had 1464 views)
-
AuthorPosts
- You must be logged in to reply to this topic.