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

Adding items to EditorDropDown

1 Answer 33 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Irfan Ahmed
Top achievements
Rank 2
Irfan Ahmed asked on 28 Mar 2012, 12:39 PM
Hi,
  I am trying to create custom drop down for toolbar in RadEditor. Below is the code that i am trying to use ...

<telerik:RadEditor ID="RadEditor1" runat="server" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"   Width="710px"><br>       
<
Tools>
<telerik:EditorToolGroup>
<
telerik:EditorTool Name="InsertImage" />             
<
telerik:EditorSeparator />      
<
telerik:EditorTool Name="InsertTable" />
<
telerik:EditorSeparator />
<
telerik:EditorDropDown Name="OutParaList" Text="Output Properties" Width="66px" >
  <% foreach(var itm in Model.OutputParameters) { %>

<
telerik:EditorDropDownItem Name="<%:itm.Name %>" Value="<%:itm.Name %>"></telerik:EditorDropDownItem >
<% } %>
</
telerik:EditorDropDown>
</
telerik:EditorToolGroup>
</
Tools>
.....
</telerik:RadEditor>


I am trying to loop through OutputParameters collection in my Model but i am getting compilation error "Code blocks are not supported in this context".

Can anybody help me resolve this issue.

Thanks for sharing your wisdom.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Mar 2012, 01:37 PM
Hello,

Yes, it is not allowed to have server code blocks inside the inner tags of RadEditor. You can see how to dynamically populate the custom dropdown in the following live demo and help article:
Custom Dropdowns demo
and
Adding Custom Dropdowns.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Irfan Ahmed
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or