2 lines of text in the column header

17 posts, 0 answers
  1. Frank
    Frank avatar
    1 posts
    Member since:
    Jul 2007

    Posted 06 Sep 2007 Link to this post

    I would like to display two line of text in my header colums ... how can this be done ?
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 07 Sep 2007 Link to this post

    Hello Frank,

    To set multi-line text in the header, you can use the following code:

    radGridView1.MasterGridViewTemplate.Columns["myColumn"].HeaderText = "first line \n Second line \n third line";

    You must also set the correct header row height trough GridTableElement.TableHeaderHeight property:

    ((GridTableElement)this.radGridView1.GridElement).TableHeaderHeight  = 50;

    You can do this through the Properties in the design view as well.

     
    All the best,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Larry
    Larry avatar
    26 posts
    Member since:
    Mar 2008

    Posted 12 Jun 2009 Link to this post

    Does this code still work for the current version of RadGrid for WinForms?  Also, what would be the code used for VB?
  4. Boryana
    Admin
    Boryana avatar
    330 posts

    Posted 12 Jun 2009 Link to this post

    Hi Larry,

    Thank you for your question. Please, consider the following code snippet:

     
     
       Me.radGridView1.MasterGridViewTemplate.Columns("myColumn").HeaderText = "first line " & vbLf & " second line " & vbLf & " third line" 
       Me.radGridView1.AutoSizeRows = True 
     
     

    You can change the header text of an existing column; in the above example, I change the text of the column with the name "myColumn". Further, you can separate the lines of the header text using \n. In the current version of RadGridView, you do not have to set manually the height of the header row. All you need is to set is the AutoSizeRows property to true. Thus, the height of all rows will be automatically calculated depending on the content of the cells in the row.

    I hope this helps. If you have further questions, do not hesitate to contact us back.

    Regards,
    Boryana
    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.
  5. manoj sagoi
    manoj sagoi avatar
    1 posts
    Member since:
    Feb 2010

    Posted 11 Feb 2010 Link to this post

    i am using \n in header its working fine in grid coloumn but when i am exporting grid data to excel ,header is scattering wherever i used \n help pls
    thx in advance
  6. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 16 Feb 2010 Link to this post

    Hello manoj sagoi,

    Thank you for writing. Currently, ExportToExcelML does not support multiline header text. We will include this feature in some of the next releases. Let me know if you have any other questions.

    Regards,
    Martin Vasilev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. zhyrox
    zhyrox avatar
    3 posts
    Member since:
    Feb 2007

    Posted 09 Aug 2011 Link to this post

    It does not work, I get the text with the symbol "\ n" and does not recognize the instruction MasterGridViewTemplate helps.

    Ciro Zamudio Adame
  8. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 11 Aug 2011 Link to this post

    Hi Ciro Zamudio Adame,

    I have tested the settings proposed in this tread and they work as expected. Could you please share with us your exact code and which version of RadControls for Winforms you are using?

    All the best,
    Martin Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  9. Sivakumar
    Sivakumar avatar
    6 posts
    Member since:
    Jul 2010

    Posted 30 Sep 2013 Link to this post

    Hi,

    I have installed the Q2 2013 release of Rad controls for WPF. I want to have to 2 rows for a single record in the rad grid view. The thing is I am using Prism framework with MEF. Is it possible to do the same in the xaml itself instead of code behind code ? If so could you please share code for this ?
  10. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 01 Oct 2013 Link to this post

    Hello Sivakumar,

    This forum concerns RadControls for WinForms, while your question seems to be related to RadControls for WPF. Please address it to the appropriate forums in order to get correct answer: http://www.telerik.com/community/forums/wpf/gridview.aspx.
     
    Regards,
    Stefan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  11. Anna
    Anna avatar
    1 posts
    Member since:
    Jan 2017

    Posted 10 May 2017 Link to this post

    http://stackoverflow.com/a/38203733/5256574

    This is a helpful answer.

  12. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3952 posts

    Posted 12 May 2017 Link to this post

    Hello Anna, 

    Thank you for writing.  

    The referred StackOverflow thread is relevant for the Kendo UI grid. However, this forum is related to the Telerik UI for WinForms suite. Feel free to use the appropriate forum for discussing different topics: http://www.telerik.com/forums

    Thank you for your understanding.

    Regards,
    Dess
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  13. vinutha
    vinutha avatar
    2 posts
    Member since:
    Dec 2016

    Posted 04 Dec 2017 Link to this post

    {field: "recordedInvestment", title: "Recorded<br>Investment",filterable: {cell: { inputWidth: gridWidth*0.06 ,type:"number",showOperators: false, operator: "eq"} },format: "{0:$ #,##.##}",minResizableWidth:gridWidth*0.06 }

     

     

    while defining the column headers use <br> tag where u want it in next line. it worked for me.

  14. Zim
    Zim avatar
    7 posts
    Member since:
    May 2018

    Posted 18 Sep 2018 Link to this post

    With Excel, we can enter a column name, and create a line break with the Alt-Enter key combination. How can we get the same effect (one or more lines in the column names) with Smartsheet?
  15. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3952 posts

    Posted 18 Sep 2018 Link to this post

    Hello, Zim,  

    I would like to note that this forum is related to the Telerik UI for WinForms suite. However, it seems that you are using Smartsheet which is not connected to our suite. Could you please confirm the product that you are currently using?

    Regards,
    Dess
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  16. nate
    nate avatar
    2 posts
    Member since:
    Nov 2018

    Posted 28 Nov 2018 in reply to Frank Link to this post

    Select the cells that you would like to apply a Wrapped Text format to;
    From the Format menu select Cells and then click the Alignment tab;
    Put a check mark in the Wrap Text option and click OK.
  17. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3952 posts

    Posted 29 Nov 2018 Link to this post

    Hello, Nate,    

    The described solution is not applicable for the RadGridView in the Telerik UI for WinForms suite which is the specified product for this forum thread.

    In order to wrap the text in the cells, it is suitable to subscribe to the RadGridView.ViewCellFormatting event and set the CellElement.TextWrap property to true

    private void radGridView1_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
    {
        e.CellElement.TextWrap = true;
    }

    I hope this information helps.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top