Hi all,
I have a grid that already contains data and headers and is styled via an isl file. I now want to change the font and font size of the whole grid (Everything incl. Cells, Headers etc.) at once.
I've already set ResolutionOrder to ControlThenApplication for the grid and then tried to set:
grid.Font = new Font(name, size, FontStyle.Regular); grid.DisplayLayout.Appearance.FontData.Name = name; grid.DisplayLayout.Appearance.FontData.SizeInPoints = size;
with no luck. Nothing changed!
Any ideas? Thanks for your help!
Regards,
Michael
Hi Michael,
Depending on the settings on the ISL, this may or may not be expected. For example: if a style is applied specifically to rows or cells, this would take precedence over a grid-level setting. This scope-based precedence applies regardless of the resolution order.
Please send over your ISL file and I can check it out to determine whether there's anything in it that would override the grid's programmatic appearance. If you would prefer not to share your files on the public forum, please let me know and I will open a private case.
Hi Mike,
in the meantime I found out that setting the following does work for me. But it is still very strabge!
grid.DisplayLayout.Bands.Layout.Override.CellAppearance.FontData.Name = name; grid.DisplayLayout.Bands.Layout.Override.CellAppearance.FontData.SizeInPoints = size; grid.DisplayLayout.Bands.Layout.Override.HeaderAppearance.FontData.Name = name; grid.DisplayLayout.Bands.Layout.Override.HeaderAppearance.FontData.SizeInPoints = size; grid.DisplayLayout.Bands.Layout.Override.RowSelectorAppearance.FontData.Name = name; grid.DisplayLayout.Bands.Layout.Override.RowSelectorAppearance.FontData.SizeInPoints = size;
I'm not allowed to post the isl file. Maybe I can setup a sample project to demonstrate the issue.
Regards
Actually, the behavior makes a lot of sense! In the first post, appearances are set at the grid level. This is one of the lower priority levels (the only lower being application level) and it's overwritten by any row or cell level settings in the ISL. In the second post, they're set at the row and cell level. This takes precedence over any row/cell ISL settings so you can see the effect in the application.
Please let me know if you have any further questions.