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

Unable to use <%# %> Databind Syntax?

7 Answers 159 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Wei Min Chan
Top achievements
Rank 1
Wei Min Chan asked on 07 Nov 2007, 02:31 PM
Hi there, just like to ask. Is it not possible to use the databinding syntax with the RadEditor control?

When I try to do so with
<Content>
<%# Container.DataItem("Wow") %>
</Content>

It blows up with an error of 
The 'Content' property of 'telerik:RadEditor' does not allow child objects.

Any other way to perform databinding with the RadEditor control?

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 07 Nov 2007, 03:03 PM
Hi Wei,

Thank you for reporting this issue.

We will investigate it and try to solve it in the next hotfix.

Currently, please set the Content property inline in the RadEditor declaration as it is shown below:

<telerik:radeditor Content='<%# Container.DataItem("Wow") %>' runat="server" ID="RadEditor1" SkinID="DefaultSetOfTools" EditModes="All">
</telerik:radeditor>

We do appreciate your feedback and we updated your telerik points.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Wei Min Chan
Top achievements
Rank 1
answered on 07 Nov 2007, 03:28 PM
Ahh.. great! Thanks a lot for the pointer guys!
0
Shash
Top achievements
Rank 1
answered on 21 Feb 2010, 07:05 PM
This does not work anymore
0
Rumen
Telerik team
answered on 22 Feb 2010, 01:40 PM
Hi Shash,

This syntax is used in the Datagrid Edit Template  example, e.g.

<telerik:RadEditor ID="RadEditor1" runat="server"
Content='<%# DataBinder.Eval(Container.DataItem, "Content") %>'>
</telerik:RadEditor>

and it works. Do you experience the problem in the live example?

Best regards,
Rumen
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.
0
Shash
Top achievements
Rank 1
answered on 22 Feb 2010, 05:15 PM
Sorry, it does work, I was using double quotes instead of single quotes.
0
Matthew
Top achievements
Rank 1
answered on 13 Apr 2010, 03:11 PM
I'd like to suggest this information get more explicitly integrated into the formal docs.

Thanks,

Matthew

0
Rumen
Telerik team
answered on 13 Apr 2010, 04:25 PM
Hello Matthew,

This information is available in the RadEditor's documentation -> Edit Template In Grid article

The key portion of markup to notice in the example below is the tag EditItemTemplate that contains the RadEditor.  You can bind text from the database to the editor by assigning the Content property with an Eval statement:

Content='<%# Eval("Body") %>'

Note that this is done as an attribute of the <telerik:RadEditor> tag and not within the <Content> child element. Also note that the Eval statement is surrounded in single quotes.


Kind regards,
Rumen
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
Wei Min Chan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Wei Min Chan
Top achievements
Rank 1
Shash
Top achievements
Rank 1
Matthew
Top achievements
Rank 1
Share this question
or