I would like to know if it is possible if the columns of the listview can be resized automatically based on the information in the listview?
Printable View
I would like to know if it is possible if the columns of the listview can be resized automatically based on the information in the listview?
If am not sure if there is an automatic way of doing this, but when you are finished populating the ListView, you could loop through each of the columns, then using TextRenderer.MeasureText find out the length of the longest string and then set the Width of the Column.
Hope that helps!!
Gary
Once again, reading the MSDN documentation is all it would take to answer this question. Looking at the member listing for the ListView class, the AutoResizeColumns method is the fifth member in the list.
oops, I did have a quick skim through the documentation, but I must have missed that one.
Sorry about that!!
Gary
i went to the MSDN and i missed it too. thanks all.