Welcome to the p2p.wrox.com Forums. You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free.
Listview doesn't have that capability. One way to accomplish this is to bring up a small form with all the subitems of the listview item in textboxes or a gridview so they can be edited.
The Tag property of the ListItem is a String (luckily, it is an int in other components), thus it is possible to concatenate multiple values using a unique separator (like vbTab). That means the Tag property needs to be parsed to get its values (with Split). Another solution (it is what I usually use) is to define a class that holds all the data for each row.
When a row is added in the list (or whatever other component like a TreeView) a new class is created and filled with the data, the class is added to a collection with a unique key and the key is stored in the Tag. Quote: quote: Originally posted by jakeone Hello, Is it possible to hide a listview control column? I want to pass the value held in that column but not necessarily display it, e.g. I have one column called 'employeeID' and another called 'employeeRefNo'.
The former is used as a database table primary key behind the scenes and, therefore, doesn't need to be displayed. The latter is used by the application user in the 'real world' and should be displayed. I've looked online and it would appear that it can't be done:( Thanks. In desing time edit your listview to have, lets say 3 columns, and do this in your code to add a row. Quote: Hello, Is it possible to hide a listview control column? I want to pass the value held in that column but not necessarily display it, e.g.
I have one column called 'employeeID' and another called 'employeeRefNo'. The former is used as a database table primary key behind the scenes and, therefore, doesn't need to be displayed. The latter is used by the application user in the 'real world' and should be displayed. I've looked online and it would appear that it can't be done:( Thanks. In desing time edit your listview to have, lets say 3 columns, and do this in your code to add a row.
![Listview Listview](http://planetsourcecode.com/Upload_PSC/ScreenShots/PIC2010510104904576.jpg)
Quote: quote: Originally posted by marcostraf The Tag property of the ListItem is a String (luckily, it is an int in other components), thus it is possible to concatenate multiple values using a unique separator (like vbTab). That means the Tag property needs to be parsed to get its values (with Split). Another solution (it is what I usually use) is to define a class that holds all the data for each row. When a row is added in the list (or whatever other component like a TreeView) a new class is created and filled with the data, the class is added to a collection with a unique key and the key is stored in the Tag.
Marco concatenate values in the tag, and parse? Awfull solution, i wouldnt do that, what about if some field user is a detail, and have the split characters, the solution could end in a app crush.