Locating a blank row and removing subsequent rows in Listview

DiverDan

Contributor
Joined
Jan 16, 2003
Messages
645
Location
Sacramento, CA
This listview is populated with calculation results in 10 columns and "Grand Totalled " in 5 of the ten columns. I've separated the calculated results from the Grand Total with a blank line. How can I find this blank line and remove it and the grand total below it. This allows the user an opportunity to forget something and not have to recalculate everything again.

btw..I have found so little documentation in literature and the web concerning anything about listview controls short of loading and sorting. Your help is greatly appreciated.
 
try this

Visual Basic:
'you can use the SubItems to itterate through all the columns and get each value...
        MessageBox.Show(Listview1.Items(Listview1.Items.Count - 1).SubItems(2).Text.ToString())

'this removes the second to the last row...
        Listview1.Items.RemoveAt(Listview1.Items.Count - 2)
 
Back
Top