first thanks for your answer, it's very important
i've reviewed the reinitilization and the code that prevents that case is :
protected void Page_Load(object sender, EventArgs e)
{
TreeViewComponent1.menuItem_Event += new EventHandler(TreeViewComponent1_menuItem_Event);
//load tree with recent values
if (!IsPostBack)
TreeViewComponent1.loadTree();
}
then treevieew is not refreshed
But is correct your affirmation: TreeViewComponent1 is a basic wrapper in which i manage the properties for all events..
updating, deleting,selecting... however SelectedNodeChangedEventArgs no returns the value that i hope
in order to get menuItem_Event i use a independent component :
public partial class components_TreeViewComponent : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
clear();
}
}
///
/// gets the selected node
///
public event System.EventHandler SelectedNode_Event;
protected void SelectedNode(object sender, NineRays.WebControls.SelectedNodeChangedEventArgs e)
{
if (this.SelectedNode_Event != null)
SelectedNode_Event(sender, e);
}
public FlyTreeNode getNode (FlyContextMenuCommandEventArgs e){
FlyTreeNode node = new FlyTreeNode();
node=flyTreeView.Nodes.FindByID(e.CommandArgument,true);
FlyTreeNode node1 = new FlyTreeNode();
node1 = flyTreeView.FindByID(e.CommandArgument);
return node;
}
}
the other cases (SelectedNodeChangedEventArgs) the result is perfect.
the page is the following:
public partial class ProcessEdition : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
TreeViewComponent1.menuItem_Event += new EventHandler(TreeViewComponent1_menuItem_Event);
if (!IsPostBack)
TreeViewComponent1.loadTree();
}
}
public void TreeViewComponent1_menuItem_Event(object sender, FlyContextMenuCommandEventArgs e)
{
TreeViewComponent1.contextMenuID_Event += new EventHandler>(TreeViewComponent1_contextMenuID_Event);
FlyTreeNode node = new FlyTreeNode();
node = TreeViewComponent1.getNode(e);
if (e.CommandName.Equals(\"Delete\")) { }
}
can i build some code in javascript in a similar form ?
Thanks in advance for your collaboration.
William