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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Editing Template Dialog with RichTextBox

Thread ID:

Created:

Updated:

Platform:

Replies:

141206 Nov 29,2018 03:53 PM UTC Dec 3,2018 08:48 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: DataGrid
Patrik Volka
Asked On November 29, 2018 03:53 PM UTC

Hello in the club,

when I paste and edit items in Grid I use Dailog Template. I want RichTextEditor in the Template Dialog, but I can not figure out how to get its content.
All other elements work correctly.


Examples are View, PartialView and Controller.


Thanks for help.

Attachment: GridWithRTE_d1bfa336.zip

Madhu Sudhanan P [Syncfusion]
Replied On December 3, 2018 07:02 AM UTC

Hi Patrik, 

We have checked your query and for  Dialog Edit template, the editors must have the name attribute and both the id and name attribute should has the value as the corresponding field name. But while using RichTextEditor, its editor element (‘textarea’)  id will be added with “-value” string  by RichTextEditor internally. This is the cause of the reported behavior. However you can achieve your requirement by reading the Editor’s value in the actionBegin event of Grid component. Please refer to the below code example, Documentation link and sample link. 

[index.cshtml] 
<div class="control-section"> 
    <ejs-grid id="Grid" dataSource="ViewBag.dataSource" actionBegin="actionBegin" actionComplete="actionComplete" toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" })" allowPaging="true"> 
        <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Dialog" template='#dialogtemplate'></e-grid-editSettings> 
        <e-grid-pagesettings pageCount="5 "></e-grid-pagesettings> 
        <e-grid-columns> 
           .  . . 
        </e-grid-columns> 
    </ejs-grid> 
</div> 
 
<script id='dialogtemplate' type="text/x-template"> 
    <div id="dialogTemp"> 
    </div> 
</script> 
 
<script> 
    function actionBegin(args) { 
        if (args.requestType === 'save') { 
            args.data['ShipAddress'] = args.form.querySelector("#ShipAddress-value").value; 
        } 
    } 
 
</script> 

[editpatial.cshtml] 
 
<div> 
    .  .  . 
    <div class="form-row"> 
        <div class="form-group col-md-12"> 
            <div class="e-float-input e-control-wrapper"> 
                    <ejs-richtexteditor id="ShipAddress" value=@Model.ShipAddress ejs-for="ShipAddress" placeholder="Popis vozu"> 
                    </ejs-richtexteditor> 
            </div> 
        </div> 
    </div> 
</div> 
 
<ejs-scripts></ejs-scripts> 



Regards, 
Madhu Sudhanan P 


Patrik Volka
Replied On December 3, 2018 08:17 AM UTC

Thanks for help

Madhu Sudhanan P [Syncfusion]
Replied On December 3, 2018 08:48 AM UTC

Hi Patrik, 
Please get back to us if you require further assistance. 
Regards, 
Madhu 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;