I do not wish for the field chooser dialog appearance to be inherited from the grid. I thought if I set SyncLookWithSourceGrid to false in the event BeforeColumnChooserDisplayed it would fix the issue and just display the columns without any formatting. It did not fix the issue. I do not want any formatting in the field chooser dialog. I just want the columns displayed. Right now because the grid header text is bold so are the columns in the field chooser dialog. If the header column is disabled so is the text in the field chooser dialog. In this particular case I cannot create my own field chooser like I do with most of the grids. This one has to be generic.
Can I modify the header appearance just for the field chooser dialog or will it also change the grid? Is there a better way to fix this issue?
Hello Michael,
Thank you for your post. If you read the documentation for the property, it says: "Specifies whether to apply appearance of the source grid to the column chooser."
The key here is that this property applies to the appearance of the grid, not to the individual header appearances. This means it copies the UseOsThemes, HeaderStyle, and Appearance from the grid's Layout. It does not apply to the individual appearances of the column headers.
So there is currently no way to turn these appearances off in the ColumnChooser. That should be submitted as a feature request.
Although you can set the appearance of the column chooser itself like explained here in the post:
https://es.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/74963/column-chooser-columns-backgrounds-are-different/380495?gasource=(direct)&gamedium=(none)&gacampaign=(not%20set)&gaterm=&gagclid=
or this:
https://es.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/2626/customising-column-chooser-grid-appearance
You can also refer to my test sample.
ColumnChooser_DrawFilter.zip
Okay. I implemented the ColumnChooserDrawFilter in the zip file. It would probably work except the Element in DrawElement method is never HeaderUIElement. It is either CheckEditorCheckBoxUIElement or UltraGridUIElement. So the code to change back color never executes.
I thought I would also mention that setting the property below in BeforeColumnChooserDisplayed fixes the display of disabled header columns in the field chooser. In other words the text is no longer greyed out. Setting Bold to false did not. I guess I expected neither of these changes to work.
Worked.
e.Dialog.ColumnChooserControl.DisplayLayout.Appearance.ForeColorDisabled = SystemColors.ControlText;
Did not work or at least did not fix the text being bold. Probably because it is already false.
e.Dialog.ColumnChooserControl.DisplayLayout.Appearance.FontData.Bold = DefaultableBoolean.False;