I am using ObjectListView instead of the standard ListView is because I wanted to word-wrap the columns.
I read in several places that the only thing I need to to in order to enable word-wrapping is the set column.wordWrap
to true.
I did just that, but it doesn't work.
What am I missing here?
Edit: I realise now that I need to make my column owner drawn. I found this page which sort of tells me what to do, but I'm not sure where to place it in my code. I'm also not quite sure whether I need to add certain attributes inside the delegate to allow word-wrapping (by the looks opf things it's enabled by default). The thing is, I tried what I found in this page, copied it word for word, and my list looks exactly the same...
If you mean by "word wrapping", you want different rows to have different heights, the FAQ answer is correct -- it simply can't be done.
However, if you make each row so that it can display two or more lines of text, then, yes, ObjectListView
can word wrap.
It needs three conditions:
WordWrap
to true on the column to wrap. You've already done that.ObjectListView
is owner drawn (set OwnerDraw
to true -- this can be done in the Form Designer). The base ListView
can't word wrap, so we have to draw the cells ourself.This is the data tab from the demo. The first column has WordWrap
set to true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With