Guys..Could anyone of you please help me with ...

say, I add a subitem to the 3rd column of a listview..now I want to remove that item and add another one in the same position (or replace)

How can I do that..

Thanks in advance

Recommended Answers

All 3 Replies

Need a little more info...

Is this a bound listview (did you give it a datasource and bind it in the code behind) or is it manually constructed, either through code or through the properties for the control?

Need a little more info...

Is this a bound listview (did you give it a datasource and bind it in the code behind) or is it manually constructed, either through code or through the properties for the control?

This is manually constructed through the properties for the control...

This is manually constructed through the properties for the control...

Check out ListView and ListViewItem.
1. The ListView is the main container
1. ListViews contain ListViewItems. These are your rows.
2. ListViewItems contain SubItems. These are your columns.

Look in the microsoft generated code in your module. You'll see where the items and subitems are created (you may have to drill around for them if you're on 2005 - I'm on 2003 for a little while longer). Use intellisense to find out what else you can do (like ListViewItem.SubItem(i) Updates, Deletes, Adds, etc. ) Once you can target a single ListViewItem, and then reveal its subitems, you can update that row.

Hope that gets you started - let us see what you come up with!

Ned

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.