hi i got problem, adding new nodes dynamically.
the nodetemplates are assigned by the templateneeded event:
my root node is a dropdownlist and when i change the selected index of the ddl, new child nodes should be added to the node.
My problem is, that the selectedchangedindex event will be not performed. Do you have an idea, why it will be not performed?
the nodetemplates are assigned by the templateneeded event:
protected
void
tree_TemplateNeeded(
object
sender, RadTreeNodeEventArgs e)
{
ANDNode x=
new
ANDNode();
e.Node.NodeTemplate = x;
}
my root node is a dropdownlist and when i change the selected index of the ddl, new child nodes should be added to the node.
My problem is, that the selectedchangedindex event will be not performed. Do you have an idea, why it will be not performed?
public
class
ANDNode : ITemplate
{
public
ANDNode()
{
}
public
void
InstantiateIn(System.Web.UI.Control container)
{
DropDownList ddl =
new
DropDownList();
ddl.AutoPostBack =
true
;
ddl.ID =
"ddl"
+Guid.NewGuid().ToString();
ddl.DataBinding+=
new
EventHandler(ddl_DataBinding);
ddl.SelectedIndexChanged +=
new
EventHandler(ddl_SelectedIndexChanged);
container.Controls.Add(ddl);
}
void
ddl_DataBinding(
object
sender, EventArgs e)
{
Global.FillExpressionItems((DropDownList)sender);
}
void
ddl_SelectedIndexChanged(
object
sender, EventArgs e)
{
DropDownList ddl = (DropDownList)sender;
RadTreeNode node = (RadTreeNode)ddl.NamingContainer;
node.ExpandMode = TreeNodeExpandMode.ServerSide;
node.Expanded =
true
;
RadTreeNode child =
new
RadTreeNode();
child.NodeTemplate =
new
ANDNode();
node.Nodes.Add(child);
}
}