RadEditor in RadGrid value not updating

5 posts, 1 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    Oct 2010

    Posted 08 Oct 2010 Link to this post

    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>

  2. Answer
    Rumen
    Admin
    Rumen avatar
    13953 posts

    Posted 11 Oct 2010 Link to this post

    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
     
  3. Michael
    Michael avatar
    6 posts
    Member since:
    Oct 2010

    Posted 18 Oct 2010 Link to this post

    Thanks that worked out perfectly :)
  4. Matt
    Matt avatar
    93 posts
    Member since:
    Jun 2012

    Posted 29 Apr in reply to Rumen Link to this post

    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??

  5. Rumen
    Admin
    Rumen avatar
    13953 posts

    Posted 02 May Link to this post

    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.
Back to Top