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

How to create Multiline Column with Wrap-Text

2 Answers 699 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 29 Aug 2016, 12:02 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 30 Aug 2016, 06:55 AM
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.
0
Dario Concilio
Top achievements
Rank 2
answered on 30 Aug 2016, 07:08 AM
Thank you for support. It's works.
Tags
GridView
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or