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

How to get image for custom drop down

1 Answer 107 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Uma
Top achievements
Rank 1
Uma asked on 16 Mar 2012, 04:43 AM
Hi Team,

I am using rad editor. i added the custom drop down using Tools.xml file and like to set the image instead of text as heading of drop down.
<tool name="InsertElement"  type="dropdown" showicon="true" showtext="false">
     <item name="xref" Value="xref"/>
     <item name="p" Value="p"/>
        </tool>
and add the back ground image using css
span.InsertElement
{
 background-image: url(../Images/icoElemCut.png);
 background-repeat :no-repeat;
 
}

using

.rade_toolbar

.InsertElement

also.
But i didnt get the image only. I got the drop down with image. I hace attached the image.

2. I need to assign the actual content to editor after editing some text in editor.

   first time, i bind the actual text to editor. It will display correct.
   then, i can edit some text and with out saving to data base, press the Reload button.
   While reloading, i will assign the actual content from data base to editor.
   It is assigned correctly in code behind. but editor shows with edited content. 
   How to refresh/update the editor while reassigning the content.

It is urgent project. Please help me.
Thanks in advance.
Uma 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 20 Mar 2012, 12:13 PM
Hello,

1) You can use the JavaScript code used in this demo to assign an image to the custom dropdown: Google Translate, e.g.

<script type="text/javascript">
        function OnClientCommandExecuting(editor, args)
        {
            if (args.get_name() == "InsertElement")
            {
                tool.get_element().getElementsByTagName("IMG")[0].src = "../Images/icoElemCut.png";




Note that the demo is hidden, because of that the Google Translation service became paid.

2) The problem is more likely related to overriding the editor content yourself, in your Page_Load method. Please note that if you read the content of the editor in an event handler (such as a button event handler) this event handler executes later in the page lifecycle compared to Page_Load. This is why, in case you set the initial content in Page_Load it is mandatory to add a check, e.g.

if (!Page.IsPostBack)
{
    RadEditor1.Content = "Some content";
}

In case you are having any difficulty, our suggestion is to implement your scenario using a simple <asp:TextBox> instead of RadEditor. Once you get the textbox to work as needed, all you need to do is change the textbox to RadEditor - and all should be fine.

In case you are able to implement your scenario with a simple <asp:TextBox>, yet you are facing trouble with the RadEditor, please send us your working project in a support ticket and we will make the change for you.

All the best,
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
Uma
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or