This is a migrated thread and some comments may be shown as answers.
RadEditor in RadGrid value not updating
4 Answers 82 Views
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 09 Oct 2010, 12:31 AM
I have a RadGrid in which i am using the RadEditor, my problem is that the other fields will update in my database but the radEditor content does not populate my update parameter.  Am i using the wrong syntax?

<telerik:RadGrid ID="gvRadGrid_Careers" runat="server" DataSourceID="ojDsCareers"
    GridLines="None" AllowPaging="True" AllowSorting="True" AllowAutomaticUpdates="True"
    AllowAutomaticDeletes="True" AutoGenerateColumns="False" AllowAutomaticInserts="True">
    <mastertableview datasourceid="ojDsCareers" datakeynames="CareerID" editmode="PopUp"
        commanditemdisplay="Top">
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <CommandItemSettings ExportToPdfText="Export to Pdf" addnewrecordtext="Add Job"></CommandItemSettings>
        <Columns>
            <telerik:GridEditCommandColumn EditImageUrl="/admin/images/icons/Edit.gif" ButtonType="ImageButton"
                HeaderText="Edit" UniqueName="EditCommandColumn" >
                <ItemStyle HorizontalAlign="Center" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="JobTitle" HeaderText="Job Title" UniqueName="JobTitle">
            </telerik:GridBoundColumn>
            <telerik:GridHTMLEditorColumn DataField="JobDescription" HeaderText="Job Description"
                UniqueName="JobDescription">
            </telerik:GridHTMLEditorColumn>
            <telerik:GridBoundColumn DataField="AddedBy" HeaderText="Added By" UniqueName="AddedBy"
                ReadOnly="True">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="DateModified" HeaderText="Last Modified" UniqueName="DateModified"
                ReadOnly="True">
                <ItemStyle HorizontalAlign="Right" />
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn ConfirmText="Delete this job?" ConfirmDialogType="RadWindow"
                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                UniqueName="DeleteColumn" ImageUrl="/admin/images/icons/Delete.gif" HeaderText="Delete">
                <ItemStyle HorizontalAlign="Center" />
            </telerik:GridButtonColumn>               
        </Columns>
        <EditFormSettings EditFormType="Template" InsertCaption="Add new job posting" CaptionFormatString="Update Job"
            CaptionDataField="CareerID" PopUpSettings-Modal="True" PopUpSettings-Width="500px" EditColumn-InsertImageUrl="Admin/images/icons/AddRecord.gif">
            <EditColumn UniqueName="EditCommandColumn1">
            </EditColumn>
            <FormTemplate>
                <div id="adminPopUp" align="center">
                    <table cellpadding="2" cellspacing="2">
                        <tr>
                            <td>
                                <p>
                                    Job Title</p>
                                <telerik:RadTextBox ID="RadTextBox1" runat="server" Text='<%# Bind( "JobTitle") %>'
                                    Width="450px">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <p>
                                    Job Description</p>                                 
                                <telerik:RadEditor ID="RadEditor1" runat="server" ToolsFile="/Admin/includes/editortools/Simple.xml"
                                    Width="450px" Height="300px" Editable="True" Html='<%#DataBinder.Eval(Container.DataItem, "JobDescription")%>'>
                                    <CssFiles>
                                        <telerik:EditorCssFile Value="~/Admin/css/EditorCss.css" />
                                    </CssFiles>
                                </telerik:RadEditor>
                            </td>
                        </tr>
                        <tr>
                            <td>
                               <asp:Button ID="Button1" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>'
                                runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'>
                            </asp:Button>
                            <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                            </asp:Button>
                            </td>
                        </tr>
                    </table>
                </div>
                <br />
            </FormTemplate>
            <PopUpSettings Modal="True" Width="500px"></PopUpSettings>
        </EditFormSettings>
    </mastertableview>
</telerik:RadGrid>
<asp:ObjectDataSource ID="ojDsCareers" runat="server" SelectMethod="GetJobsList"
    TypeName="DouglasEmmett.clsCareers" DeleteMethod="DeleteJob" UpdateMethod="UpdateJob">
    <DeleteParameters>
        <asp:ControlParameter ControlID="gvRadGrid_Careers" Name="CareerID" PropertyName="SelectedValue"
            Type="Int32" />
    </DeleteParameters>
    <UpdateParameters>
        <asp:ControlParameter ControlID="gvRadGrid_Careers" PropertyName="SelectedValue" Name="CareerID" Type="Int32" />
        <asp:ControlParameter ControlID="gvRadGrid_Careers" PropertyName="SelectedValue" Name="JobTitle" Type="String" />
        <asp:ControlParameter ControlID="gvRadGrid_Careers" PropertyName="SelectedValue" Name="JobDescription" Type="String" />
        <asp:SessionParameter DefaultValue="Web Test" Name="Addedby" SessionField="AdminUser" Type="String" />
    </UpdateParameters>
</asp:ObjectDataSource>

4 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 11 Oct 2010, 09:00 AM
Hello Michael,

RadEditor for ASP.NET AJAX does not offer Html property. You should use the Content property to get and set the content in the editor, e.g.

Content='<%#DataBinder.Eval(Container.DataItem, "JobDescription")%>'>

Please, see this article for more information: Edit Template In Grid help article and demo RadGrid Edit Template.

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
Michael
Top achievements
Rank 1
answered on 18 Oct 2010, 10:08 PM
Thanks that worked out perfectly :)
0
Matt
Top achievements
Rank 1
answered on 29 Apr 2019, 02:08 PM

I really wish that Telerik would remove out dated posts like this... RadEditor content CANNOT be set this way. In fact, the property doesn't exist and the link is to the plethora of AJAX tools, not to the Edit Template in the Grid directly.

Setting the content on the server side on a RadGrids ItemDataBound doesn't work either.

Setting the content declarative doesn't work either as it won't allow child objects??

0
Rumen
Telerik team
answered on 02 May 2019, 11:40 AM
Hi Matt,

Thank you for your feedback and idea, which I will share with the tech team supporting the forums.

I've updated the non working link to the documentation as well as included another one for a demo:

You may also want to use two way databinding by using Bind instead of Eval.


Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Asked by
Michael
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Michael
Top achievements
Rank 1
Matt
Top achievements
Rank 1
Share this question
or