This is a migrated thread and some comments may be shown as answers.

How could i rename folder in RadTreeView in button click

0 Answers 26 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
New
Top achievements
Rank 1
New asked on 08 Sep 2012, 04:55 AM
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

No answers yet. Maybe you can help?

Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
New
Top achievements
Rank 1
Share this question
or