Reputation: 12804
I have a listview in Details view and I have added columns. I would like to have the column header increase in height and either word-wrap the header text or allow me to specify the line break using a CrLf.
Is this possible using the standard .NET controls?
Upvotes: 2
Views: 3962
Reputation: 3303
Better ListView control does just this and it is written pure managed (.NET) code.
Both column headers and items (and even group headers) can contain arbitrary multi-line text, even with custom line breaks. Maximum number of lines can be limited by a property:
Upvotes: -1
Reputation: 941407
That's difficult, you cannot control the column header height directly. You can do it indirectly by giving the ListView a big Font. You then need to set the OwnerDraw property to true and implement the DrawItem, DrawSubItem and DrawColumnHeader events. The latter lets you word-wrap the text. You will also need to set the Font property for each ListViewItem you add so they are not drawn large as well. Unpleasant but not impossible.
Upvotes: 3