Editing Listview Items and Subitems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Trevor

    #1

    Editing Listview Items and Subitems

    Hello

    I am currently adding items and subitems to a listview but I know that
    the user will expect to click on a row and edit the contents.
    I have tired looking at other posts but none of them are helpful,
    because they all suggest that the subitems cannot be edited.

    I currently have 2 textboxes and the user is expected to input valules
    into those textboxes which on a click button event I populate the
    listview item and subitem. There are 2 ways I would like to handle
    this:

    1. If the user clicks on the row then the contents of the item and
    subitem should populate in textbox1 and 2 so that it can be changed
    but I would need to change the old entry or remove the entry and re-
    add it.

    2. The second way I would like to handle this would be to click on
    either the item or subitem and which ever I click on then that item
    should be highlighted and I should able to change the value in that
    field.

    I am not sure if this can be done by changing the properties of the
    listview or if I need to code this and if I need to code this I would
    need some help if possible.

    Trevor

  • Johnny J.

    #2
    Re: Editing Listview Items and Subitems

    Here's a solution that works perfectly for me:



    It's in C#, but can of course be converted to Vb. If you're not good at
    that - or don't want to spend the time, you can just compile it to a DLL and
    add it to your solution.

    Good luck,
    Johnny J.



    "Trevor" <trevor.niemack @za.syspro.comw rote in message
    news:1190118313 .179127.117770@ k79g2000hse.goo glegroups.com.. .
    Hello
    >
    I am currently adding items and subitems to a listview but I know that
    the user will expect to click on a row and edit the contents.
    I have tired looking at other posts but none of them are helpful,
    because they all suggest that the subitems cannot be edited.
    >
    I currently have 2 textboxes and the user is expected to input valules
    into those textboxes which on a click button event I populate the
    listview item and subitem. There are 2 ways I would like to handle
    this:
    >
    1. If the user clicks on the row then the contents of the item and
    subitem should populate in textbox1 and 2 so that it can be changed
    but I would need to change the old entry or remove the entry and re-
    add it.
    >
    2. The second way I would like to handle this would be to click on
    either the item or subitem and which ever I click on then that item
    should be highlighted and I should able to change the value in that
    field.
    >
    I am not sure if this can be done by changing the properties of the
    listview or if I need to code this and if I need to code this I would
    need some help if possible.
    >
    Trevor
    >

    Comment

    Working...