Sometimes we face problems with ListView. The problem is that: suppose you have set the column width of a ListView in design time. But when the ListView is populated with data, then we see if there exists much data, all data are not showed. After some words “….” appears. This means more data exists. But we can size a column of its contents. Just write down the following code after adding an item to the ListView.
[c#]
lvTest.Columns[0].Width = -1;
[vb]
lvTest.Columns(0).Width = -1
Here lvTest is the name of the ListView. If the column width is set to -1, the column is sized to the width of the widest item in it.
Monday, December 1, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment