'TreeListView (ObjectListView) get parent node
I was just wondering if there was a way to get the text of the parent node when I click one of the child nodes. It should be a very simple functionality but it doesn't seem to be build in.
string ParentNode;
string SelectedNode;
private void treeListView1_CellRightClick(object sender, CellRightClickEventArgs e)
{
// ParentNode = (trying to get this values)
SelectedNode = e.Item.Text;
}
Solution 1:[1]
to get previous node value on any column:treeListView1.Items[treeListView1.GetItem(treeListView1.SelectedIndex - 1).Index].SubItems[0].ToString();
OrolvColumn1.GetStringValue(treeListView1.GetModelObject(treeListView1.SelectedIndex - 1))
to get previous node value on current column:treeListView1.GetItem(treeListView1.SelectedIndex - 1).Text
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Josh |
