Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > GridView > How to display Header Text on two lines

Not answered How to display Header Text on two lines

Feed from this thread
  • George avatar

    Posted on Jun 1, 2009 (permalink)

    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

    Reply

  • George avatar

    Posted on Jun 1, 2009 (permalink)

    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

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.
  • Martin Vasilev Martin Vasilev admin's avatar

    Posted on Jun 4, 2009 (permalink)

    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.

    Reply

  • Posted on Nov 9, 2011 (permalink)

    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

     

    Reply

  • Svett Svett admin's avatar

    Posted on Nov 11, 2011 (permalink)

    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.

    Reply

  • Say Hello to Telerik's PivotGrid for ASP.NET AJAX, Silverlight, WPF and WinForms. Now packed with OLAP support.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > GridView > How to display Header Text on two lines
Related resources for "How to display Header Text on two lines"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]