Get ListView Column name property

Lucretius

New member
Joined
Feb 12, 2009
Messages
4
Programming Experience
3-5
Hello all,

Any reason why:

VB.NET:
Expand Collapse Copy
Debug.Print(Me.MyListView.Columns(0).Name.ToString)

always returns an empty string?

I am trying to loop through through all of the items and subitems in a listview control and add them to an xml doc like so:

VB.NET:
Expand Collapse Copy
'loop through each item & Subtime and add element
            For i = 0 To Me.MyListView.Items.Count - 1
                .WriteStartElement("MyElemnt")

                For j = 0 To Me.MyListView.Items(i).SubItems.Count - 1  
                    .WriteElementString(Me.MyListView.Columns(j).name.ToString, Me.MyListView.Items(i).SubItems(j).Text)
                Next j

                .WriteEndElement()
            Next i

However, I can't use the NAME prop of .columns(j) because it is always an empty string.

TIA
 
Back
Top