Listview Hidden field...

Ennio

Member
Joined
Mar 5, 2006
Messages
23
Programming Experience
Beginner
Is it possible to Hide a field on the listview?

I need when the user right click on the listview, and click delete to get the index (That I can do) and delete from the listview, but since the index on the listview is not the same on my DB, I need somehow to get the USERID (that I don't display on the listview). So if I could hide a field I can just get the value from the listview and send to my query to delete the right item.

or do you guys have any other idea?

Thanks
 
You can't hide a field in ListView, but you can set the ListViewItem.Tag property for reference.
 
ok I think that should do it for me, but when I add the TAG i get this error msg. (Object Reference not set to an instance of an object)


Dim lvItem As ListViewItem
lvItem = frm.lsvReport.Items.Add(myDataRow.Item("Name"))
lvItem.Tag.Equals(myDataRow.Item("Id"))
 
Tag is a string property:
VB.NET:
lvItem.Tag = myDataRow.Item("Id").ToString

 
Back
Top