How to create Multiline Column with Wrap-Text

3 posts, 1 answers
  1. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 29 Aug Link to this post

    Hi to all,

    I would set columns to keep multi line in ColumnHeader content, with vertical and horizontal alignment.

    I attached with example.

    How can I do this?

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 30 Aug Link to this post

    Hello Dario,

    Thank you for writing.

    You should set the column's WrapText and Multiline properties. In addition, you need to make sure that the cell is large enough to fit the entire text. Here is an example:
    Protected Overrides Sub OnLoad(ByVal e As EventArgs)
        MyBase.OnLoad(e)
        Dim col As GridViewTextBoxColumn = TryCast(radGridView1.Columns("Name"), GridViewTextBoxColumn)
        col.HeaderTextAlignment = ContentAlignment.TopLeft
        col.HeaderText = "Column Multiline Very long 2"
        col.WrapText = True
        col.Multiline = True
        col.Width = 100
        radGridView1.TableElement.TableHeaderHeight = 36
    End Sub

    I hope this will be useful. Let me know if you have additional questions.
     
    Regards,
    Dimitar
    Telerik by Progress
    Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 30 Aug in reply to Dimitar Link to this post

    Thank you for support. It's works.
Back to Top