Nevron Forum

iterate NTreeList

https://www.nevron.com/Forum/Topic4122.aspx

By Vince McMullin 1 - Friday, September 3, 2010

Hello,

I wish to iterate through the NTreeList and collect a particular subitem for each row.

With a listview I did something like this:
'For Each lvItem As ListViewItem In ListView3.Items
' pmStationList.Add(lvItem.SubItems(1).Text)
'Next

I am not sure about the NTreeList

Any ideas?
By Nevron Support - Friday, September 3, 2010

Hello Vince,

It is almost the same.

List<NTreeListNodeSubItem> items = new List<NTreeListNodeSubItem>();
int columnIndex = 1;
int nCount = nTreeList1.Nodes.Count;

for (int i = 0; i < nCount; i++)
{
    NTreeListNode currentNode = (NTreeListNode)nTreeList1.Nodes[i];
    items.Add(currentNode.SubItems[columnIndex]);
}