RadMenuItem with placeholders

3 posts, 0 answers
  1. Andrey
    Andrey avatar
    5 posts
    Member since:
    Mar 2015

    Posted 04 Mar 2015 Link to this post

    I originally coded two buttons via C# to appear on page load inside a rad menu item which originally contained a radcombobox and two input items:
        <telerik:RadMenuItem runat="server" Value="WorkspaceMenuItems">
                                <telerik:RadComboBox ID="ComboBoxViews" runat="server"/>
                                <input type="button" value="Create View" />
                                <input type="button" value="Manage Views"/>

    My question I guess is how can I use placeholders inside a radmenuitem ?, the way I have it is like so:

    var menu = ((RadMenu)Master.FindControl("MenuMaster")).FindItemByValue("WorkspaceMenuItems");

    However the thing I don't like is that on the webpage the buttons added show too near eachother, not like the ones originally placed there. I included picture...is there a way to go about it using placeholders or is there another easy way ?"? thanks!!!!
  2. Ivan Danchev
    Ivan Danchev avatar
    1306 posts

    Posted 06 Mar 2015 Link to this post


    I recreated your scenario and managed to reproduce the behavior you are describing. Here's how you can increase the distance between the added buttons:

    1. You can add a CSS class to the buttons you are adding dynamically, for instance:
    Button btn = new Button();
    btn.ID = "btnTest";
    btn.Text = "dynamically created";
    btn.CssClass = "menuButton";

    2. Then you can use the following CSS rule:
    html .menuButton:last-of-type {
        margin-left: 4px;

    to increase the distance between the ultimate and penultimate button.

    Ivan Danchev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. Andrey
    Andrey avatar
    5 posts
    Member since:
    Mar 2015

    Posted 06 Mar 2015 in reply to Ivan Danchev Link to this post

    This is really good, thanks for the reply I actually did something a little bit different but doing the same thing. This approach looks cleaner. 
Back to Top