This is a migrated thread and some comments may be shown as answers.

RadMenuItem with placeholders

2 Answers 52 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Andrey
Top achievements
Rank 1
Andrey asked on 04 Mar 2015, 09:00 PM
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">
                        <ItemTemplate>
                            <telerik:RadComboBox ID="ComboBoxViews" runat="server"/>
                            <input type="button" value="Create View" />
                            <input type="button" value="Manage Views"/>
                        </ItemTemplate>
                    </telerik:RadMenuItem>

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");
        menu.Controls.Add(exportAcfps);
        menu.Controls.Add(exportAvails);

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 Answers, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 06 Mar 2015, 04:06 PM
Hello,

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.

Regards,
Ivan Danchev
Telerik
 

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.

 
0
Andrey
Top achievements
Rank 1
answered on 06 Mar 2015, 06:10 PM
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. 
Tags
Documentation and Tutorials
Asked by
Andrey
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Andrey
Top achievements
Rank 1
Share this question
or