Results 1 to 5 of 5

Thread: ListView column keys

  1. #1

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819

    ListView column keys

    I've always tended to give keys to my ListView columns so that I can be sure that I'm editing the correct sub item. For example:

    Code:
    itmItem.SubItems(lvwData.Columns("Port").SubItemIndex) = "Dover"
    ... sets the "Port" column for the current ListView item to "Dover". However, I can't find the .Net equivalent - it seems to only allow you to reference the columns by the integer index value. Is there a way around this, or am I just going to have to make sure that I don't move or add to my columns?

    Thanks...
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    How about the 'tag' property of the listviewitem !!

  3. #3

    Thread Starter
    Fanatic Member InvisibleDuncan's Avatar
    Join Date
    May 2001
    Location
    Eating jam.
    Posts
    819
    I can't refer to the item using the tag, though.
    Indecisiveness is the key to flexibility.

    www.mangojacks.com

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by InvisibleDuncan
    I can't refer to the item using the tag, though.
    Can't find any other ways , rather than trying IndexOf or making your own ListView control .

  5. #5
    New Member
    Join Date
    Mar 2004
    Posts
    6
    From what source are you adding items to the listview? Is it from a database, xml file or what? I know a solution to the problem you are having, but need a little more information to be able to expalin how to do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width