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. Image for the cookie policy date

Grid rowheights in AutoScaled forms

Hi, When Large fonts are enabled in the Windows(Control panel -> Display -> Settings -> Advanced -> General -> Font size: Large fonts (120 dpi)) and the form AutoScale is true, grid control is not displaying the cell text properly. 1. Set the windows to use large fonts. 2. Run the DataboundSortByDisplayOrder (or any other grid sample). 3. Notice that text is chopped off at the abottom of (y, g, q etc.). How Can I make my grid auto scale properly? Does the grid adjust row heights automagically by looking at the current font settings? If not can you please suggest a workaround. I am using 1.6.1.8/vs.net 2003/xp/win2k. thanks, - Reddy

1 Reply

AD Administrator Syncfusion Team December 11, 2003 10:01 PM UTC

The grid defaults the row height to 17. It is not set based on the default font. But I think you can use code like this to set the default row height based on font height.
Font f = this.gridDataBoundGrid1.BaseStylesMap["Standard"].StyleInfo.GdipFont;
using(Graphics g = this.gridDataBoundGrid1.CreateGraphics())
{
	float height = 5 + f.GetHeight(g.DpiY);
	this.gridDataBoundGrid1.DefaultRowHeight = (int) height;
}

Loader.
Up arrow icon