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?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
wafflePosted Jan 31, 2007, 4:04 AM
Suraj RaiPosted Jan 31, 2007, 2:48 AM
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....