Update listview
VS2005
i'm adding items to a listview. i want to make sure that if the item already exists, it will just update the quantity and will not make another row. meaning, there will be no duplicate. how to do this?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Suraj Rai93 pointsPosted Jan 30, 2007, 9:48 PM EST
Hi,
Its simple.....Jus rotate through the listview items like this...
For(int i = 0; i < ListView1.Items.Count; i++)
{
if(string.Equals("Your String",ListView1.Items[i].Text)) // Depends if it is subitem change the code a little
{
// Here write the code for updating perticular column....
}
}
I guess it helps.....
Happy programming....
1 short reply
waffle43 pointsPosted Jan 30, 2007, 11:04 PM EST