it compiles but it doesn't work =(
i have also tried this one but the same thing no effect...
do you have any other ideas?
i use code behind, my code looks like:
------------------------------------------------------------
[...]
<iewc:TreeView id="MenuTree" runat="server"
onselectedindexchanged="MenuTreeSelectChanged">
<iewc:TreeNode Text="A"></iewc:TreeNode>
<iewc:TreeNode Text="B">
<iewc:TreeNode Text="B1"></iewc:TreeNode>
<iewc:TreeNode Text="B2"></iewc:TreeNode>
<iewc:TreeNode Text="B3"></iewc:TreeNode>
<iewc:TreeNode Text="B4"></iewc:TreeNode>
</iewc:TreeNode>
<iewc:TreeNode Text="C">
<iewc:TreeNode Text="C1"></iewc:TreeNode>
<iewc:TreeNode Text="C2"></iewc:TreeNode>
<iewc:TreeNode Text="C3"></iewc:TreeNode>
</iewc:TreeNode>
</iewc:TreeView>
[...]
------------------------------------------------------------
namespace ControlCenter
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Microsoft.Web.UI.WebControls;
public abstract class Menu : System.Web.UI.UserControl
{
protected Microsoft.Web.UI.WebControls.TreeView MenuTree;
private void Page_Load(object sender, System.EventArgs e){}
public void MenuTreeSelectChanged(Object sender,
TreeViewSelectEventArgs e)
{
// This doesn't work...
MenuTree.GetNodeFromIndex(e.OldNode).Expanded=false;
MenuTree.GetNodeFromIndex(e.OldNode).Expanded=true;
}
//region Web Form Designer generated code
[...]
}
}
------------------------------------------------------------