visual studio 2012 - Treeview C# Click on a node for a text to appear -
i have treeview multiple nodes (eg. a, b, c). if click on "b", want word "hello" appear in textbox.
i have method this:
private void treelist_selectednodechanged(object sender, system.eventargs e) { this.layoutcontrolitem1.text="hello"; }
the hello text appearing though i'm not clicking on node. doing right?
the best event use nodemouseclick
.
private void treeview1_nodemouseclick(object sender, treenodemouseclickeventargs e) { this.layoutcontrolitem1.text = e.node.tag.tostring(); }
the simplest way different massages each node store them in nodes' tags:
somenode.tag = "some message";
note selectionchanged
fire more want to, including each time selection cleared..
if need include keyboard selection should include check treeview1.selectednode != null
in code..
Comments
Post a Comment