#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    5
    Rep Power
    0

    C# ListView: Need the string from the selected subitem


    I'm making this Email Address Book, just for a little training...
    I have a ListView with two columns! First one, name, second one, email address.
    Now when I select an item(the name), and click a button, the subitem(mail addy), needs to be copied to another TextBox.
    Anyone know how I can do this?
    Last edited by fwm; August 31st, 2003 at 06:23 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Brisbane, Australia
    Posts
    50
    Rep Power
    12
    yourListView.SelectedItems[row_Index].SubItems[col_index].Text
    // if you only want the first selected item, then replace row_index with 0.
    // single selection mode listview will most likly to use 0 as the row_index
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    5
    Rep Power
    0
    Yeah got it, thanks!

IMN logo majestic logo threadwatch logo seochat tools logo