473,382 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Hide some columns of listview

Hi,

I want to know how to hide a column of listview.
Thanks in advance
Mar 16 '06 #1
3 6526
You can´t really, or not easily (you should have to set the width to 0 and
prevent the user resizing it with some API calls/notifications). If you need
to hold extra data for each listitem that you don´t want to show, you can
create a class that derives from ListViewItem, add the extra property,
create instances of it, and add them to the listview.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Li Pang" <Li****@discussions.microsoft.com> escribió en el mensaje
news:57**********************************@microsof t.com...
Hi,

I want to know how to hide a column of listview.
Thanks in advance

Mar 16 '06 #2
A simpler way is to create a class/structure to hold the data and then store
instances of that class in the ListViewItem.Tag property

/claes

"Carlos J. Quintero [VB MVP]" <ca*****@NOSPAMsogecable.com> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
You can´t really, or not easily (you should have to set the width to 0 and
prevent the user resizing it with some API calls/notifications). If you
need to hold extra data for each listitem that you don´t want to show, you
can create a class that derives from ListViewItem, add the extra property,
create instances of it, and add them to the listview.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Li Pang" <Li****@discussions.microsoft.com> escribió en el mensaje
news:57**********************************@microsof t.com...
Hi,

I want to know how to hide a column of listview.
Thanks in advance


Mar 16 '06 #3
Hi Claes,

I don´t like to store things in the Tag property because it is not clear
what that bag can contain since it is declared as Object and if you have to
declare a separate class anyway to hold the data (more than one value) it is
better to use inheritance, IMO.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Claes Bergefall" <cl*************@nospam.nospam> escribió en el mensaje
news:e2**************@tk2msftngp13.phx.gbl...
A simpler way is to create a class/structure to hold the data and then
store instances of that class in the ListViewItem.Tag property

/claes

Mar 21 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via...
1
by: Scott Kay | last post by:
Hi, When I use the AllowColumnReorder in the ListView Control, this allows the user to reorder columns by dragging them around. Any items added to the control after the user has reordered them...
3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
0
by: CR | last post by:
I'm having a problem with the Listview control. I populated a Listview with 4 columns. On my PC they show up just fine, the right hand edge of the 4th column lines up with the right hand edge of...
3
by: Li Pang | last post by:
Hi, I'd like to know how to hide a column of the listview control. anybody gives a hand? Thanks in advance
3
by: simchajoy2000 | last post by:
Hi, I am trying to use a VB.NET listview object to display information from a datatable. I need to have two columns of information but I don't want the user to be able to select each column...
3
by: Chris | last post by:
Is it possible to hide specific rows in a listview? I currently have a listview in details view and the user can select multiple views which shows the listview items matching the selected...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
1
by: MrNobody | last post by:
what's the trick in showing/hiding columns in ListView's Details view mode? I can change a columns width to 0 and it effectively makes it disappear but then you can actually resize the column to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.