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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Font Orientation and cell/row width and heigth

Thread ID:





3791 Apr 9,2003 04:34 AM UTC Apr 9,2003 01:48 PM UTC WinForms 1
Tags: GridControl
Michael Mann
Asked On April 9, 2003 04:34 AM UTC

Hi, I'm playing around with the font's orientation in header cols. All I want to have is that the font is oriented by 90 degrees and the whole text is displayed in the (header) cell. But I don't manage it. Can someone give me a hint? Here's my code snippet: private void Form1_Load(object sender, System.EventArgs e) { gc[1,1].Text = "isdahfkashdfasdfjaskfdjaslkdfjklsjdfkasjdfklsjfkljasldkfj"; gc[1,1].Font.Orientation = 90; //gc[1,1].WrapText = false; //gc.ColWidths.ResizeToFit(Syncfusion.Windows.Forms.Grid.GridRangeInfo.Cell(1,1)); gc.RowHeights.ResizeToFit(Syncfusion.Windows.Forms.Grid.GridRangeInfo.Cell(1,1)); gc.Refresh(); } thanks, Michael

Administrator [Syncfusion]
Replied On April 9, 2003 01:48 PM UTC

There appears to be a problem with the RowHeights.ResizeToFit handling the Orientation properly. We will have to look into it. As a workaround, you could calculate the string length and use that for the row height. Here is a little snippet.
private void Form1_Load(object sender, System.EventArgs e)
	this.gridControl1[1,1].Text = "isdahfkashdfasdfjaskfdjaslkdfjklsjdfkasjdfklsjfkljasldkfj";
	this.gridControl1[1,1].WrapText = false;
	this.gridControl1[1,1].Font.Orientation = 90;

	Graphics g = this.gridControl1.CreateGraphics();
	this.gridControl1.RowHeights[1] = 
 		(int) g.MeasureString(this.gridControl1[1,1].Text ,this.gridControl1.Font).Width; 		

	//this.gridControl1.ColWidths[1] = 24;



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.

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