Skip to content

Update listview

waffle

Asked Jan 30, 2007, 5:46 AM EST2 answers
Share
LinkedInX
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.

  • 0

    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....

    0
  • 1 short reply
    • 0
      tnx 4 d help bro!
      0