Beispiel #1
0
    protected void RadTreeView_Toolbox_NodeDrop(object sender, Telerik.Web.UI.RadTreeNodeDragDropEventArgs e)
    {
        RadTreeNode sourceNode = e.SourceDragNode;

        if (e.HtmlElementID != null)
        {
            PlaceHolder   myPlaceHolder = (PlaceHolder)Page.Master.FindControl("PlaceHolder_DesignMode");
            HtmlInputText _currentPlaceholderPosition = (HtmlInputText)myPlaceHolder.FindControl("currentPlaceholderPosition");
            HtmlInputText _currentZoneTB = (HtmlInputText)myPlaceHolder.FindControl("currentZoneTB");

            int dockCurrentPos = int.Parse(_currentPlaceholderPosition.Value);

            PageEditorMgr myPageEditorMgr = new PageEditorMgr();

            RadDockLayout myDockLayout = (RadDockLayout)this.Page.Master.FindControl("RadDockLayout_DesignMode");

            RadDock myDock = myPageEditorMgr.Add_DesignMode_NewControl(this.Page, myPage_Loading_Info, sourceNode, _currentZoneTB.Value, dockCurrentPos);

            myDockLayout.Controls.Add(myDock);

            //UpdatePanel myUpdatePanel = (UpdatePanel)myDockLayout.FindControl("UpdatePanel_Docks");
            //myUpdatePanel.ContentTemplateContainer.Controls.Add(myDock);


            ScriptManager.RegisterStartupScript(
                myDock,
                this.GetType(),
                "AddDock",
                string.Format(@"function _addDock() {{  
            Sys.Application.remove_load(_addDock);  
            $find('{1}').dock($find('{0}'),{2});   
            $find('{0}').doPostBack('DockPositionChanged');   
            }};  
            Sys.Application.add_load(_addDock);", myDock.ClientID, _currentZoneTB.Value, dockCurrentPos),
                true);

            CreateSaveStateTrigger(myDock);
        }
    }