Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

EnsureVisible a treeview node by using the node Fullpath

$
0
0

My application is coded in C#.  I know how to get the path of a node, but how can I EnsureVisible a node using the path?  The following code results in a null value for the selected node even though the path in msFirstNodeFullPath is correct:

trvEquipment.SelectedNode = trvEquipment.Nodes[msFirstNodeFullPath];
trvEquipment.SelectedNode.EnsureVisible();

I have also tried the following:

trvEquipment.Nodes[msFirstNodeFullPath].EnsureVisible();

and...

trvEquipment.Nodes[0].Nodes[msFirstNodeFullPath].EnsureVisible();


REvans


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>