Changing font at runtime

Hi I am trying to change the font of the grid cells, using the following code: gridMain.Appearance.AnyRecordFieldCell.Font = new GridFontInfo( font ); Where font is a System.Windows.Drawing.Font object. For some reason I can only change the font once. If I try to do it a 2nd time. The grid crashes. Any ideas?

1 Reply

AD Administrator Syncfusion Team November 30, 2005 09:18 AM UTC

Before setting the font, try calling style.ResetFont to see if this makes things work all the time. this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.ResetFont(); this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.Font = new GridFontInfo(new Font("Courier New", 10));

Loader.
Up arrow icon