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

RadEditor inside EditItem template not updating Content

1 Answer 33 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 30 Aug 2012, 09:36 AM
Hi, 

   I Have a RadEditor inside a RadGrid ItemTemplate like this:

 <EditItemTemplate>
              <telerik:RadEditor ID="descriptionEditor" Runat="server" EditModes="Design" Font-Size="X-Small" Height="300px" Skin="Sunset" Width="100%" Html='<%# Bind("description") %>' Font-Names="Segoe UI,Arial,sans-serif" >


   But when i change the content while "editing", later in codebehind UpdateCommand event, i get the previous value of "desciption" and not the update one (see the codebehind below: If description is "aaa", and i edit to "bbb", the variable newdescription in the event is still "aaa".

 protected void grid_UpdateCommand(object source, GridCommandEventArgs e)
        { 
            if (e.CommandName == RadGrid.UpdateCommandName)
            {
                GridEditFormItem item = (GridEditFormItem)e.Item;
                if (e.Item is GridEditFormItem)
                {
                    RadEditor descriptionEditor = (RadEditor)item.FindControl("descriptionEditor");


                    string newDescription = descriptionEditor.GetHtml(EditorStripHtmlOptions.None);
                    onProgressReportGrid.Rebind();


                }
            }
        }

Can you help me, please ?
Kind regards

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Sep 2012, 02:31 PM
Hi,

RadEditor for ASP.NET AJAX does not have a Html='<%# Bind("description") %> property. You should use the Content property instead of Html as explained in this article: Edit Template In Grid.

My suggestion is to also review the code of the following Datagrid Edit Template demo as well as this KB article on the subject: RadEditor Content Not Saved After Ajax Update in Firefox, Google Chrome and Safari.

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
Marco
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or