add a new dropdown

Last post 04-30-2008, 5:33 PM by hamid_gsts. 5 replies.
Sort Posts: Previous Next
  •  04-29-2008, 3:25 PM 39901

    add a new dropdown

    Hi! Is there a way to add a new dropdown just like the codes dropdown. I am using the codes dropdown to store some html code for the user controls I created. So, now I need another dropdown to store or list some htm code for another category..That's whay I need two Codes dropdown on the page. Thanks!
     
    ps: or is there a way to configure the links dropdown to work like the codes dropdown, cos I am not using the links dropdown.
  •  04-29-2008, 3:59 PM 39903 in reply to 39901

    Re: add a new dropdown

    I added this code:

    private void AddDropDown()

    {

    ToolControl control = this.Editor1.ToolControls["Codes2"];

    if (control != null)

    {

    RichDropDownList ddGallery = new RichDropDownList(this.Editor1);

    ddGallery.Width = Unit.Pixel(120);

    //dropdown.Width = 120;

    ddGallery.Items.Add("Image Gallery", "some html");

    ddGallery.Items.Add(new RichListItem("Select"));

    control.Control.Controls.Add(ddGallery);

    }

    }
    and I went to Languages>en-us and added this:

    <resource name="Codes2">Choose A Control</resource>

    But the textbox is not showing up. Thanks!
  •  04-30-2008, 3:28 PM 39931 in reply to 39903

    Re: add a new dropdown

    Any help on how to do this??
  •  04-30-2008, 3:35 PM 39932 in reply to 39931

    Re: add a new dropdown

    dynamically populate the dropdown menu
    How to dynamically populate the dropdown menu?( C# | VB )
    This example demonstrates how to programmatically populate the Cute Editor dropdown menu.
    dynamically populate the tree view dropdown menu
    How to dynamically populate the tree view dropdown menu?( C# | VB )
    This example demonstrates how to programmatically populate the Cute Editor tree view dropdown menu.
     
    Please check the above examples.

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  04-30-2008, 4:04 PM 39933 in reply to 39932

    Re: add a new dropdown

    Hi Adam! I don't have a problem populating the dropdown..I need help creating a new one just like the Codes dropdown. Thanks!!
  •  04-30-2008, 5:33 PM 39934 in reply to 39932

    Re: add a new dropdown

    Hi! I was able to add a dropdown in the toolbar, but When I click on my item(image gallery) no code gets dropped on in the editor:
    The onchange code I think is for the link dropdown. What would be the event for the codes dropdown?

    private void AddNewDropDown()

    {

    if (Editor1.ToolControls["insertcustombutonhere"] != null)

    {

    Control container = Editor1.ToolControls["insertcustombutonhere"].Control;

    CuteEditor.RichDropDownList ddGallery = new CuteEditor.RichDropDownList(Editor1);

    ddGallery.Width = Unit.Pixel(120);

     

    //must set this css name

    ddGallery.CssClass = "CuteEditorDropDown";

    ddGallery.Items.Add("[[Controls]]", "");

     

    //hide the first item (caption) in the float-panel

    ddGallery.RichHideFirstItem = true;

    //add - !!!

    //if the statements put before Controls.Add , the statements must be executed every time

    container.Controls.Add(ddGallery);

    //if the statements put after Controls.Add the statements could be executed only the first time

    //or add items here if(!IsPostBack)

    if (!IsPostBack)

    {

    ddGallery.Items.Add("Image Gallery", "<div style=\"width: 445px; color: red; background-color: #254256\">Image Gallery User Control<script type=\"text/javascript\" src=\"Silverlight.js\"></script><script type=\"text/javascript\" src=\"SlideShow.js\" ></script><div><script type=\"text/javascript\">new SlideShow.Control(new SlideShow.XmlConfigProvider());</script></div><div></div></div>");

    }

    }

    }

View as RSS news feed in XML