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

How to Programatically create RadEditor with No Menus

1 Answer 104 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 04 Nov 2010, 11:03 AM
Hi

I am filling a listbox based on the values selected in a tree view, the list box items need to be a RadEditor, i have this working but sometimes when the list box items are created and added the RadEditor Menu items are displayed aswell (this does not happen all the time).  I dont want the menu items to display as i only want to show the content as though it was a textbox with no editing functionality. Can i set the Menu Property at the point of creating the content item to ensure that the menu does not show.

My Code that creates the ListBox Item and Editor Content is as follows :
For Each node In RadTreeViewTCs.GetAllNodes
 
                    If node.Checked = True Then
                       'Do Some Stuff Here
                    ElseIf node.Checked = False Then
 
                        Dim Value As New RadListBoxItem
                        Dim Content As New RadEditor
 
                        Content.Content = node.Text.ToString
                        Content.Width = "150"
                        Content.Height = "75"
                        Value.Controls.Add(Content)
                        ListBoxExcludedTCS.Items.Add(Value)
 
                    End If
 
                Next node
 
                ListBoxExcludedTCS.DataBind()

1 Answer, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 08 Nov 2010, 04:57 PM
Hi Anthony,

You can achieve the required result by assigning an XML file containing only <root> node to the RadEditor's ToolsFile property, e.g.:
Content.ToolsFile = "~/NoToolsToolsFile.xml"
NoToolsToolsFile.xml content:
<?xml version="1.0" encoding="utf-8" ?>
<root>
</root>

Please let us know if this helps.

Best wishes,
Dobromir
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Anthony
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or