Empty CSS Class Dropdown when loading from C#

  •  03-10-2008, 12:05 PM

    Empty CSS Class Dropdown when loading from C#

    I using the c# method below to load the css dropdown. the program runs through successfully but the dropdown is empty (except for the title that is in the config file):
     
    AutoParseClasses is set to false;
     
    The config line is:
    <item type="dropdown" name="CssClass" width="70" RenderItemBorder="true" text="[CSS Class]" command="CssClass" />

     

    public void SetCSSClassList(){
    CuteEditor.ToolControl toolctrl = this.ctlRichTextBox.ToolControls["CssClass1"];
    if(toolctrl!=null)
    {
    CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)toolctrl.Control;
    //the first item is the caption
    CuteEditor.RichListItem richitem=dropdown.Items[0];
    //clear the items from configuration files
    dropdown.Items.Clear();
    //add the caption
    dropdown.Items.Add(richitem);
    //add value only
    dropdown.Items.Add("RedColor");
    //add text and value
    dropdown.Items.Add("Highlight","Highlight");
    //add html and text and value
    dropdown.Items.Add("<span class='BoldGreen'>Bold Green Text</span>","Bold Green Text","BoldGreen");
    }
    }
     
    I have tried running the method from both Page_load and OnPreRender with the same results
     
    Thanks
    Mike
View Complete Thread