So while browsing the web, I noticed a couple of people were having the same issue with this control. I managed to hack together some JavaScript using some of the existing script provided by the .NET framework. The following code sets the currently selected TreeViewNode into focus.
function SetSelectedTreeNodeVisible(controlID) {
var theForm = document.forms['aspnetForm'];
if (!theForm) {
theForm = document.aspnetForm;}
var selectedID = theForm.elements[controlID];
if (selectedID != null) {
var selectedNode = document.getElementById(selectedID.value);
if (selectedNode != null) { selectedNode.scrollIntoView(true); }
}
}
To use this code in your page, just call the function like so
SetSelectedTreeNodeVisible('<%= TreeViewName.ClientID %>_SelectedNode');Replace TreeViewName with the name of your TreeView control. This code should be called at the end of the page so that the treeView has had time to load.
Recently I bought an SSD drive and I am very impressed still with its performance. Last week I installed a new 4GB stick into the laptop bring the total amount of RAM in the machine to 8GB. It all installed well and Windows happily told me I had 8GB of usable memory. But there was a considerable decrease in perceived performance.
If like me you have installed the 