I am using a ultraTree with Outlook ViewStyle and want to display columns having different back colors.
I have tried to apply header apperance back color in ColumnSetGenerated event but it didn't work.
newColumn.HeaderAppearance.BackColor = Color.Red;
Please, can you tell me, whats going wrong?
HeaderAppearance only affects the column header. Are you saying that the HeaderAppearance is not changing the color of the column header? Or that you are trying to change the appearance of the cells and not the header?
Thanks Mike for your quick reply.
Yes.. HeaderAppearance is not changing the color of the column header.
The most common reason for that is that the headers are using operating system themes.There's a KB article about this here:
HOWTO:Change the Color of Column Headers in the WinGrid
The article is talking about the grid, but it's the same issue in the tree. Try setting ThemedElementAlpha to Transparent on the same appearance on which you are setting the BackColor. Or turn off themes for the whole try by setting UseOsThemes to false.
I tried setting ThemedElementAlpha to Transparent , but no luck still HeaderAppearance is not changing the color of the column header.
This is what i am trying to do.
ultraTree.UseOsThemes = DefaultableBoolean.False;
foreach (var column in ultraTree.ColumnSettings.ColumnSets.Columns)
column.HeaderAppearance.BackColor = Color.Red;
Are you loading a Style Library (.isl file) into your application?
If the isl file applies a background image to the column headers, then that image would cover the background and you would not be able to see the color.