C# – nyway to wrap the text in the ListView

cwinforms

I have message is too long to fit in the column. I have table with four columns my fourth column is "Message" which has string long string and it doesnot fit in columnwidth. I want to Make the text in column as Warp so that all the text is visible to the user.

  ListViewItem lv = new ListViewItem();
                    lv.Text = det_view.filename;
                    lv.SubItems.Add(det_view.number.ToString());
                    lv.SubItems.Add(det_view.Date_Time.ToString());
                    lv.SubItems.Add(det_view.Message); // here the string too long and need wrap the message
                    listView1.Items.Add(lv);

Regards

Best Answer

Short of having your listviewitems ownerdrawn, you might have a look at ObjectListView. It will wordwrap just fine and may suite your needs.