• Welcome to Valhalla Legends Archive.
 

Listview adding item after sorting

Started by CrAz3D, January 29, 2005, 02:02 PM

Previous topic - Next topic

CrAz3D

        lvINFO.ListItems.Add , , cboType.Text
        lvINFO.ListItems(lvINFO.ListItems.Count).ListSubItems.Add , , txtTime.Text
        lvINFO.ListItems(lvINFO.ListItems.Count).ListSubItems.Add , , txtAmount.Text
        lvINFO.ListItems(lvINFO.ListItems.Count).ListSubItems.Add , , Date


I have my regular listview code that would typically add the itme @ the bottom of the listview...HOWEVER, since my items have been sorted the item is added in the listview according to where cboType.text should end up.  I'm not sure how to add the rest of the information (txtTime, txtAmount, & Date) to the correct index.  It wouldn't work by using the find function or w/e because cboType.text is listed multiple times in the listview already. 

Any ideas on how I would find the correct index to add the txtTime, txtAmount & Date to my listview?
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...

Adron

Doesn't Add return something for you to use if you need to reference the newly added item?

CrAz3D

Well, the way I remedied this is busing some pscode code I found
Set lItem = lvINFO.ListItems.Add(, , cboType.Text)
        lItem.ListSubItems.Add , , txtTime.Text
        lItem.ListSubItems.Add , , FN.Amount(cboType.Text, txtTime.Text)
        lItem.ListSubItems.Add , , Date
        lItem.Selected = True

lItem is an iteger
rebundance - having or being in excess of sheer stupidity
(ré-bun-dance)
Quote from: Spht on June 22, 2004, 07:32 PMSlap.
Quote from: Adron on January 28, 2005, 09:17 AMIn a way, I believe that religion is inherently evil, which includes Christianity. I'd also say Christianity is eviller than Buddhism (has more potential for evil).
Quote from: iago on April 19, 2005, 01:06 PM
CrAz3D's ... is too big vertically, at least, too big with ... iago ...