Re: How does the StyleDropDown work? (attaching styles to it)

  •  11-25-2004, 11:17 AM

    Re: How does the StyleDropDown work? (attaching styles to it)

    Dear All:
     
    Happy Thanksgiving Day !

    The CuteEditor 4.0 move many control from the Editor.ControlName to the Configuration file.

    So , the CssClass/CssStyle is just defined in the configuration file (including the command name)

    When you want to get the control by programming ,

    You could use this code :

    C#CuteEditor.ToolControl toolctrl=Editor1.ToolControls["CssStyle"];

    if the "CssStyle" is defined in the Full.config specify by the Editor1.AutoConfigure ,

    you could get the control using expression "toolctrl.Control" . for the dropdown , the control type is CuteEditor.RichDropDownList , so you could do this :

    C#if(!IsPostBack)
    {
        CuteEditor.ToolControl toolctrl=Editor1.ToolControls["CssStyle"]; 
        if(toolctrl!=null)
        {
            CuteEditor.RichDropDownList rddl=(CuteEditor.RichDropDownList)toolctrl.Control;
            //Items.Add(html,text,value);
            rddl.Items.Add("<b>bold text</b>","*bold text*","font-weight:bold");
        }
    }

     
    Regards , Terry .
View Complete Thread