Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (base.Module != null)
        {
            this.controlPanel = null;
            if (base.Module is WebModule)
            {
                this.controlPanel = ((WebModule)base.Module).CreateControlPanel(this, true);
            }
            else
            {
                this.controlPanel = base.Module.CreateControlPanel(this);
            }
            if (this.controlPanel != null)
            {
                this.controlPanel.ID = "contolPanel";
                this.ControlPanelHolder.Controls.Add(this.controlPanel);
            }

            if (this.controlPanel is Telerik.Web.IControlPanel)
            {
                Telerik.Web.IControlPanel ctrlPnl = (Telerik.Web.IControlPanel) this.controlPanel;
                foreach (Telerik.Web.ICommandPanel cmdPnl in ctrlPnl.CommandPanels)
                {
                    this.ToolBoxHolder.Controls.Add((Control)cmdPnl);
                }
            }
            else
            {
                int i = 0;
                foreach (IControlPanelCommand ctrl in base.Module.CreateToolBoxControls(this))
                {
                    if (ctrl is Control)
                    {
                        i++;
                        Control ctrl2 = ctrl as Control;
                        ctrl2.ID = "toolBox" + i;
                    }
                    ctrl.ControlPanelID = "contolPanel";
                    this.ToolBoxHolder.Controls.Add((Control)ctrl);
                }
            }
        }
    }
Пример #2
0
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        if (this.controlPanel is IControlPanel)
        {
            IControlPanel pnl = (IControlPanel)this.controlPanel;
            this.ControlPanelTitle.InnerText = pnl.Title;
        }
        else if (this.controlPanel is Telerik.Web.IControlPanel)
        {
            Telerik.Web.IControlPanel pnl = (Telerik.Web.IControlPanel) this.controlPanel;

            if (pnl is IViewModeControl)
            {
                // Ivan's note: UX does not want the title for the new modules, only breadcrumb
                this.ControlPanelTitle.Visible = false;
            }
            else
            {
                this.ControlPanelTitle.InnerText = pnl.Title;
            }
        }
    }