How do I override the font for a summary?
summ = grid.DisplayLayout.Bands(0).Summaries.Add("SummaryName", SummaryType.Sum, _ grid.DisplayLayout.Bands(0).Columns("Test"))summ.Appearance.BackColor = Drawing.Color.LightYellowsumm.Appearance.BorderColor = Drawing.Color.LightGray
I can change the bordercolor, backcolor, but how do I set the font?
I want the summary to have the same font as the grid above it.
Thanks.
summ.Appearance.FontData
Um, what am I supposed to set here?
summ.appearance.FontData.<what property?> = gridAbove.Font
The only available properties are:BoldDisposedItalicNameNonDefaultSettingsNotifyIdSizeInPointsTagUnderline
I tried summ.appearance.FontData.Name = gridAbove.Font.Nameand that didn't change it.
Have you set the Font property on the grid? My guess is that you did not and so gridAbove.Font.Name is just returning the ambient font and so it is not changing anything.
The grid was set to the Aero layout. If I debug the grid.font.name, it's "Microsoft Sans Serif".
Even if I enter that directly, rather than the way I wrote, same effect. No font change.
Also, if I print the summ.Appearance.FontData.Name, it returns "Nothing". Both before and after I try to set it.
If the FontData.Name is returning null AFTER you set it, then something is seriously wrong. I don't see how this could possibly happen.
In any case, you can't use the Font property of the grid to get the font being used by a cell. The grid's Font property will only return what you set it to, as will any Appearance object in the grid.
The easiest thing for you to do would be to open up the aero.isl file nad look at what font settings are being used on the grid cells and apply those same settings to the summaries. It sounds to me like this might even be an oversight on our part, so you might want to report this to Infragistics Developer support so they can have someone check it out.
Another option would be to try use a ResolvedAppearance method try to resolve the appearance of the cell so you can determine the actual font name being used at run-time.