We have a legacy thick client product with windows forms initially designed using NetAdvantage 2004 Vol2 and NetAdvantage Ultimate 2011 Vol2. On later versions of Windows 10, the font in our results grid appears different from the MS Sans Serif we are accustomed to seeing, and when a cell is selected, WingDings are displayed. We do not explicitly set any specific font. The only thing we ever set font-wise is to either bold and set a font color so it has been a little difficult to step through the control intitialization and see why it is rendering differently. I do not see where the font is being applied or changed during initialization or event handling. This only seems to affect environments running version 1803 (Creator Update) of Windows 10. Older versions of Windows 10 and all versions of Windows 7 are unaffected. I've attempted to update the font in the grid in the Display Layout Appearance section, but it does not make any difference. The grid's font property is set to Microsoft Sans Serif, 8.25pt in Visual Studio properties page. This is happening across the entire thick client, 100's of forms, not just a few few forms.
Is there possibly a default native font defined in Infragistics that is not available in Windows 10 update? Looking at my Surface Tablet which is running the 1703 update of Windows 10, this issue does not appear, and it seems that the same fonts are installed on both machines.
This is what the form looks like the the design view:
This is what it looks like at run time with a cell selected:
Hello David,
The reason for WingDings being shown in results Grid when selecting a cell could be because of the font that’s being used. It might not be having a fallback font and when it can’t find any font, Grid might be showing WingDings. To ensure this is the case you could do a quick test. Use a Label and TextBox on the Form and see if you were able to observe the same behavior. If the WingDings weren’t showed when you do this test then please send us a sample of this issue and we will investigate it further.
I will continue to look into this issue as soon as I hear from you.
Thanks for looking at this Sahaja. The label and text box controls do not display the same behavior. All of the controls, including the ultra grid, have the font name set to Microsoft Sans Serif. But only the grid is displaying a different font at run time. I narrowed down that the font being displayed in the grid is Bahnscrift. Then, when a cell is selected, the highlighted text is wingdings. I would note that we do not use any custom fonts in our application, we just use the fonts that are included with Windows.
I did notice that the grid control also contains a "Display Layout" property that contains nodes for 'Appearance', each of which contains their own font settings. These font settings were not set by default, so I updated them to use Microsoft Sans Serif in 8 pt, but it still displayed the wayward Bahnscrift and wingdings at run time.
I found I am able to work around the issue by clearing the Bahnscrift font value in the registry and creating a font substitute that maps Bahnscrift to Microsoft Sans Serif. But I don't feel this is the correct approach to resolving the issue, I would rather fix the software issue instead of hacking the registry.
I will look at getting a code sample to you, it will take me a bit to get a small sample that reproduces the same issue.
Hi David,
You seem to be saying some contradictory things here. You repeatedly say that you are not using any custom fonts and that everything in your application is using MS Sans Serif, but then you say that that grid is displaying using Bahnscrift.
Are you saying that Bahnscrift is being used to display the grid even though you have not set it to do so anywhere in your application?
If you don't set a font on anything, then the DotNet framework falls back to the ambient font, which on American English machines is MS Sans Serif. There's nothing in the grid that would change that for any reason. So if your grid is using Bahnscrift then something in your application has to be assigning that font somewhere.
If you search your code for "Bahnscrift" and don't find it, then there are several other places it could be coming from. If you are loading a layout into the grid, the layout might be setting a font on any one of the grid's Appearance properties. In this case, since the font is only appearing in the active cell, then the obvious guess would be the EditCellAppearance on the Override of either the DisplayLayout or the band. It could also be applied to the ActiveCellAppearance, so I would recommend putting a button on your form as a test and then at run-time, check the font name on all of these appearances:
Debug.WriteLine(this.ultraGrid1.DisplayLayout.Override.EditCellAppearance.FontData.Name); Debug.WriteLine(this.ultraGrid1.DisplayLayout.Bands[0].Override.EditCellAppearance.FontData.Name); Debug.WriteLine(this.ultraGrid1.DisplayLayout.Override.ActiveCellAppearance.FontData.Name); Debug.WriteLine(this.ultraGrid1.DisplayLayout.Bands[0].Override.ActiveCellAppearance.FontData.Name);
If that doesn't turn up anything useful, then another possibility is that one of these settings is being affected by AppStylist. Check your code for a call to the "StyleManager.Load" method to see if you are loading a style library. If so, then this could be affecting the font without actually setting any of the properties on the grid.
BTW... How did you determine that the grid is display using Bahnscrift? Do you mean the WHOLE grid? Or just the active cell in edit mode?
I just tested the UltraGrid on my work PC using Windows 10 build 1803 with Infragistics Windows Forms 2011 V2 build 1000.
The only way the cells' font show changes is if I explicitly set the FontName property on the DisplayLayout override as mentioned above.
Please review my sample below and modify it so it reproduces the behavior and send it back here. Let me know if you have any questions.
UltraGridFontTest.zip
I will try to reproduce this issue using Windows 10 1803 update. Once I create a sample and observe this behavior, we will test it further to investigate what’s causing this. If you already have a sample, please send it to us. It will help us in investigating this issue faster.
I will post an update by end of day Thursday.
Please let me know if you have any questions.
The TextRenderingMode was set to Default, I tried both GDI and GDIPlus, but with the same errant results.
Hm, that is really surprising. I was really expecting the other controls on the form to have the same issue once you were not setting the font on them.
The only other thing I can think of that makes the grid different in any way is the TextRenderingMode. That might be worth a try, just as a matter of curiosity.
When I step over the configuration block, it doesn't affect how other controls are configured. The other controls do not have the same problem as the grid. That is very curious to me because I would have expected them to display the wrong font like the grid did. I even looked at the lower level properties of the Font and saw that the System Font Name was configured in the same way the grid's font was before I overwrote it with the specification properties in the configuration code. So I am baffled by the whole thing.
¯\_(ツ)_/¯
If you have a morbid curiosity about it, I can possibly see about setting up a web meeting to demonstrate it, but I'm sure you are as busy as we are and I am good with just modifying the base class behavior with the workaround to make it all go away.
Thanks again for everything.