I have a treeview inside a tab in a modalpopupextender, I have a routine which selects and expands a node based on the user search, the issue I have is it will not scroll in to view.
i have tried numerous ways but to no avail, last effort was this, after the search happens I call this function
private void SetJavaScriptSearch()
{
//string stv = @"var elem = document.getElementById('{0}_SelectedNode');
// if(elem != null )
// {
// var node = document.getElementById(elem.value);
// if(node != null)
// {
// node.scrollIntoView(true);
// }
// }";
string stv = @"var elem = document.getElementById('sitecontent_tabs_tpDetails_tvGenerict38');
if(elem != null )
{
var node = document.getElementById(elem.value);
if(node != null)
{
node.scrollIntoView(true);
}
}";
//ScriptManager.RegisterStartupScript(this, GetType(), "myscript", stv.Replace("{0}", tvGeneric.ClientID), true);
ScriptManager.RegisterStartupScript(this, GetType(), "myscript", stv, true);
}
Here is the page
<a class="selectedNode treeNode treeNode" id="sitecontent_tabs_tpDetails_tvGenerict38" style="text-decoration: none;" href="javascript:__doPostBack('ctl00$sitecontent$tabs$tpDetails$tvGeneric','s80')">Test Category</a>