CF v1.1 ListView Item

How can I identify a ListView item by a string/number value at run-time In Visual Basic 6 I used a KEY property to do that job but in C# CF v1.1 I can't find it.

Thanks!



Answer this question

CF v1.1 ListView Item

  • Igor Deck

    Thanks for reply StriderIRL, but it's not what i need. Text property is visible for user. I need the Key propety that is not visible for user and it can store a database ID field. When I click the ListView Item, I can use this value to execute a SQL query.

    Can i find such a property in CF v1.x or CF v2.0


  • Sorex

    This is one way

    Dim l_lvi As ListViewItem = listView1.FocusedItem
    msgbox l_lvi.Text




  • BurtonJ

    Thanks for reply StriderIRL. I will try this.
  • Nick Christian

    there is no KEY field in the listview

    if you use a listbox you have a VALUE property which is the same as KEY in VB6

    if you use a listview you would need to put the text property of the listviewitem

    Dim l_lvi As New ListViewItem(l_dr.Item("ID").ToString)
    l_lvi.SubItems.Add(l_dr.Item("RouteNo").ToString)


  • CF v1.1 ListView Item