Get object from TreeView node in c #

I am writing an AutoCAD plugin that shows all entities as nodes in a TreeView. I want to be able to get an object from Node in order to be able to work with software. This is my code when Node is clicked:

private void treeView1_MouseClick(object sender, MouseEventArgs e)
        TreeNode node = treeView1.SelectedNode;
        propertyGrid1.SelectedObject = node;
        /*Entity selectedEntity = node.getObject() as Entity; Pseudo-code, need to know how to do this*/



source to share

1 answer


has a property Tag

that allows you to associate an object with Node.



All Articles