By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

How to hide a coloumn of the listview

P: n/a
Hi,

I'd like to know how to hide a column of the listview control. anybody gives
a hand?

Thanks in advance
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* "=?Utf-8?B?TGkgUGFuZw==?=" <Li****@discussions.microsoft.com> scripsit:
I'd like to know how to hide a column of the listview control. anybody gives
a hand?


Don't add the column and store the data in your 'ListViewItem's' 'Tag'
property instead.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2

P: n/a
Hi,

Set its width to 0

DirectCast(ListView1.Columns.Item(2), ColumnHeader).Width = 0

Ken

--------------------------------------

"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:04**********************************@microsof t.com...
Hi,

I'd like to know how to hide a column of the listview control. anybody gives
a hand?

Thanks in advance
Nov 21 '05 #3

P: n/a
There's one problem setting the width to 0 if you have the columns as
resizable. You or a user of your app could resize the column to make it
visible again which might not be very pretty if you are using that column to
store some sort of ID for each row in your listview. I would go with
Herfried's idea of using the 'Tag' property and use it to identify each row.

Imran.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:Oa**************@TK2MSFTNGP11.phx.gbl...
Hi,

Set its width to 0

DirectCast(ListView1.Columns.Item(2), ColumnHeader).Width = 0

Ken

--------------------------------------

"Li Pang" <Li****@discussions.microsoft.com> wrote in message
news:04**********************************@microsof t.com...
Hi,

I'd like to know how to hide a column of the listview control. anybody gives a hand?

Thanks in advance

Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.