We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

A Way To Add Rich Text Editor To Gird External Form Template

Hello,

I am new to Syncfusion and i need to create a form to be used for editing grid. And at this form, i need a Rich Text Editor. 

Is there a way to do this? any samples?

Thanks for your helps.

Erdem

1 Reply

AR Ajith R Syncfusion Team January 8, 2015 09:02 AM UTC

Hi Erdem,

Thanks for using Syncfusion products.

Query : RicheTextEditor (RTE) in External Form Template Editing

We suggest you to use ExternalFormTemplate edit mode in the EditSettings with ExternalFormTemplateID and set the textarea inside the script template for RTE control. We can render the RTE control in the ActionComplete client side event when the request type as “beginedit”. Please refer the below code snippet for further details.

@(Html.EJ().Grid<ExternalEditingRTE.OrdersView>("FlatGrid")

        .Datasource((IEnumerable<object>)ViewBag.datasourc

        .EditSettings(edit => { edit

                     .AllowAdding()

                     .AllowDeleting()

                     .AllowEditing()

                     .EditMode(EditMode.ExternalFormTemplate).ExternalFormTemplateID("#ExternalTemplate");

         })

        .ClientSideEvents(eve=>eve.ActionComplete("onActionComplete"))

           ----------

)

@*Script Template*@

<script id="ExternalTemplate" type="text/template">

    <b>Order Details</b>

    <table cellspacing="10">

        --------        

    </table>

    <textarea id="RTE" rows="5" cols="30" style="width: 400px; height: 150px">

    </textarea>

</script>

<script type="text/javascript">   

    function onActionComplete(args) {

        if (args.requestType == "beginedit")

            $("#RTE").ejRTE(); // Rendering RTE control

    }

</script>

For you convenience we have created a simple sample and the same can be downloaded from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/117904/ExternalEditingRTE-1834440198.zip

Please let us know if you have any concerns.

Regards,

Ajith R



Loader.
Live Chat Icon For mobile
Up arrow icon