This is a migrated thread and some comments may be shown as answers.

How to display Header Text on two lines

4 Answers 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 01 Jun 2009, 11:49 AM
Hi All,

In order to save space and for information purposes I am trying to display a column header text in two lines if possible like:

==============
Exepnses
($ per day)
=============

Is there a suitable way to do this?

Regards,

George

4 Answers, 1 is accepted

Sort by
0
George
Top achievements
Rank 1
answered on 01 Jun 2009, 01:39 PM
meanwhile, found the answer. It seems the "/n" does not work in this case and the environment.newline has to be used instead, as gridview1.columns(0).headertext="first line" & environment.newline & "second line"

Cheers all,

George
0
Martin Vasilev
Telerik team
answered on 04 Jun 2009, 07:14 AM
Hi George,

Thank you for writing. "\n" does not work because in VB.Net it is an escape sequence. You have already find the right way to add the new line. You could use the following code, too:
 
Me.radGridView1.Columns(0).HeaderText = "First Line " & vbLf & "Second Line"   
DirectCast(Me.radGridView1.GridElement, GridTableElement).TableHeaderHeight = 40  

Do not hesitate to contact me again if you have other questions.

All the best,
Martin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ram
Top achievements
Rank 1
answered on 09 Nov 2011, 11:38 AM
Hi
I too have same requirement.
I tried like this in Init event
But second word is overlaping the first one even though I set the headerstyle height more.

callogGrd.Columns[7].HeaderText =

 

"TimeTo"+Environment.NewLine+"Answer";
I tried by placing \n also but same result.
can any one help me on this asap

 

0
Svett
Telerik team
answered on 11 Nov 2011, 12:46 PM
Hi Ram,

You should ask all question related to ASP.NET AJAX Controls in the corresponding forum section, which is observed by the ASP.NET AJAX support guys.

Kind regards,
Svett
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
GridView
Asked by
George
Top achievements
Rank 1
Answers by
George
Top achievements
Rank 1
Martin Vasilev
Telerik team
Ram
Top achievements
Rank 1
Svett
Telerik team
Share this question
or