By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,261 Members | 1,674 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,261 IT Pros & Developers. It's quick & easy.

Editing Listview Items and Subitems

P: n/a
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

Sep 18 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Here's a solution that works perfectly for me:

http://www.codeproject.com/cs/miscct...ellEditors.asp

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" <tr************@za.syspro.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.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

Sep 18 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.