We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Virtual Grid Font

Thread ID:





29587 May 29,2005 06:56 PM UTC Jun 9,2005 01:19 AM UTC WinForms 3
Tags: GridControl
Ken Law
Asked On May 29, 2005 06:56 PM UTC

I have a number of virtual grids where I would like to set the font for all the cells programatically. When I try the following code I get a runtime exception: this.vgTests.BaseStylesMap["Standard"].StyleInfo.Font = new GridFontInfo(font); There seems to be a number of places to specify fonts when using a virtual grid in the designer. Please advise as to the best way to change manipulate grid fonts from code. Thanks.

Administrator [Syncfusion]
Replied On May 30, 2005 02:03 AM UTC

Try code like: Font f = new Font("Courier", 14, FontStyle.Bold|FontStyle.Italic); this.gridControl1.BaseStylesMap["Standard"].StyleInfo.Font.ModifyStyle(new GridFontInfo(f), Syncfusion.Styles.StyleModifyType.Changes);

Ken Law
Replied On June 8, 2005 11:48 PM UTC

I put your code sample in the constructor of the control that hosts the GridControl so it runs after InitializeComponent. InitializeComponent contains the following code for the GridControl''s font property generated by the Property Browser. The font property code seems to take precedence over setting the Standard style in the BaseStylesMap. Can you tell me the relationship between the grid''s font property and the styles? I would like to be able to control the font of row and column headers independently of the cell fonts. Thanks.

Administrator [Syncfusion]
Replied On June 9, 2005 01:19 AM UTC

>>I would like to be able to control the font of row and column headers independently of the cell fonts. The row and column styles (fonts) are controlled by grid.baseStylesMap["Row Header"].StyleInfo.Font and grid.baseStylesMap["Column Header"].StyleInfo.Font. Th etop-left cell is controlled by grid.baseStylesMap["Header"].StyleInfo.Font.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon