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.
Unfortunately, activation email could not send to your email. Please try again.

Virtual Grid Font

Thread ID:

Created:

Updated:

Platform:

Replies:

29587 May 29,2005 02:56 PM Jun 8,2005 09:19 PM Windows Forms 3
loading
Tags: GridControl
Ken Law
Asked On May 29, 2005 02:56 PM

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 29, 2005 10:03 PM

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 07:48 PM

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 8, 2005 09:19 PM

>>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.

CONFIRMATION

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.

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.

;