Hi,
I wonder if anyone know how to sum the total of the value in a listview (not listbox). I can have the total value in a textbox.
I have tried:
If anyone can help?Please Login or Register to view this content.
Hi,
I wonder if anyone know how to sum the total of the value in a listview (not listbox). I can have the total value in a textbox.
I have tried:
If anyone can help?Please Login or Register to view this content.
If your subitem content is value then
If the subitem contains formatted numbers such as £1,234.56 then you will need to strip charactersPlease Login or Register to view this content.
You can try this in the immediate window
Alternatively you could sum the values from the cells as you populuate the listview rather than reading from the listview controlPlease Login or Register to view this content.
Yeah i had to remove the .Text. But however, how can I sum the total for i listitems?
This code does not make sense to me.Please Login or Register to view this content.
I found the way to sum it.. Thanks.
Please Login or Register to view this content.
I have another concern. The result is shown as per ur textgrade.text (lets say a textbox).
I have a button to delete some listing.. How can make that same textbox refresh the new total after deleting those listing?
After the code deletes the lines you need to run that code again to recalculate total.
If you put the code in a function you can use 1 set of code in many places.
The to make use of it you can usePlease Login or Register to view this content.
And the line above can be put in your code any time you finish adding, deleting or editing items in the listview.Please Login or Register to view this content.
Nice!! Thank you very much for the help!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks