Is there a way to make cells of a certain column look like the headers of a grid?
I have tried to clone the appearance, but that doesn't seem to do the trick...
_grid.DisplayLayout.Bands[0].Columns["Test"].CellAppearance = (AppearanceBase)_grid.DisplayLayout.Override.HeaderAppearance.Clone();
Oh, cool, I didn't realize there's a constructor for Appearance that takes an AppearanceData. :)
Works like a charm, thanks!
AppearanceData appData = new AppearanceData(); _grid.DisplayLayout.Bands[0].Columns[ASFieldMapping.FriendlyName1PropertyName].Header.ResolveAppearance(ref appData); Appearance appearance = new Appearance(ref appData); _grid.DisplayLayout.Bands[0].Columns[ASFieldMapping.FriendlyName1PropertyName].CellAppearance = appearance;
If you examine the properties of the HeaderAppearance you are using here, you will probably see that none of them are actually set to anything - unless you set them. The Appearance properties don't contain the actual appearance of any given object. They exist so that you can override the default settings. At run-time, the grid resolves all of the appearances that affect an object, like it's HeaderAppearance, the HeaderAppearance on the Override, the Layout override, application styling, etc.
To get the actual properties of an object, you will need to resolve the appearance. The grid objects expose methods to allow you to resolve the appearances for most objects. In this case, you want the appearance of a header, so you need to find an individual header object and call it's ResolveAppearance method:
this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Header.ResolveAppearance(...)
This will give you an AppearanceData object. From there you will need to create an Appearance and copy the property settings over (there's no wuick way to do it like Clone).