How could i rename folder in RadTreeView in button click

Thread is closed for posting
1 posts, 0 answers
  1. New
    New  avatar
    25 posts
    Member since:
    Jul 2012

    Posted 07 Sep 2012 Link to this post

    Hi

    Select node RadTreeView Add Folder clcik to create folder then select folder name to rename.
    see my attach my screen shot.
    Button click coding:

    protected void AddFolder_OnClick(object sender, EventArgs e)
            {
                RadTreeNode node = (RadTreeNode)TicketFoldersTreeview.SelectedNode;
                if (node != null)
                {
                    node.Nodes.Add(new RadTreeNode("New Folder"));
                }
                int parentId = (int)Convert.ToInt32(GetNode.Value);
                Ticket_Folder ticFolder = new Ticket_Folder();
                Ticket_Folder parentFolder = DbClient.GetList<Ticket_Folder>("Ticket_Folders_ID = " + parentId)[0];
     
                RadTreeNode newNode = new RadTreeNode();
                string nodeName = Resources.Common.New_Folder;
                ticFolder.Ticket_Folders_Name = nodeName;
                ticFolder.Ticket_Folders_PARENT_ID = parentId;
                ticFolder.Ticket_Folders_Global = parentFolder.Ticket_Folders_Global;
                ticFolder.Ticket_Folders_People_ID = ((TBS.HelpDesk.Model.TBSSecurity)(Session["SecurityClass"])).People_ID;
     
                DbClient.Insert<Ticket_Folder>(ticFolder);
     
                newNode.Text = nodeName;
                newNode.Value = ticFolder.Ticket_Folders_ID.ToString();
                newNode.Attributes.Add("PeopleID", ((TBS.HelpDesk.Model.TBSSecurity)(Session["SecurityClass"])).People_ID.ToString());
                newNode.AllowEdit = true;
                hdNodeCount.Value = "1";
                string strScript = "Sys.Application.add_load(function(){ EditableNode(\"" + newNode.Value + "\")})";
                ScriptManager.RegisterStartupScript(this.Page, typeof(string), "ScriptKey", strScript, true);
            }

    Java Script:
    function EditableNode(value) {
            debugger
                if (document.getElementById('hdNodeCount').value == '1') {
                    var tree = $find("<%= TicketFoldersTreeview.ClientID %>");
                    var node = tree.findNodeByValue(value);
                    if (node != null) {
                        node.startEdit();
                    }
                }
            }


    Thanks Advance,
    New Gene
Back to Top