TreeView Events
Events arising from user interaction can be directed to the server by setting the AutoPostBack property to true. Server-side script should be used when handling events for both uplevel and downlevel browsers because the rich DHTML behaviors used in the Internet Explorer 5.5 or later versions are not used in the downlevel page content.
For a Web page that has a TreeView, the main interaction by the user is to expand and collapse the nodes in the tree to explore the content. The following sample code shows how the onexpand, oncollapse, and onselectedindexchange events can be handled in a Web Form using C#.