TreeNodeAdv and highlighting the SelectedNode

I understand the concept of the SelectedNode property of the TreeViewAdv control but is there a way to programmaticly set the UI state of the SelectedNode?
In particular, I'd like to set the Selected Node as being highlighted in blue as if a user had selected it. Ideally, it would be cool to raise the Click event on that node as well.

1 Reply

JA JayaLakshmi Syncfusion Team June 22, 2007 12:47 PM UTC

Hi Mark,

Thank you for using Syncfusion products.

To programmatically select a node, use the code snippet below.

this.treeViewAdv1.SelectedNode = this.treeViewAdv1.Nodes[1];

To highlight the selected node, you can go with the properties SelectedNodeForeColor and SelectedNodeBackground.

Please refer the sample below and let me know if you have anyother queries.

http://websamples.syncfusion.com/samples/Tools.Windows/F62790/main.htm

Regards,
Jaya

Loader.
Up arrow icon