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.
Unfortunately, activation email could not send to your email. Please try again.

Multiline edit in grid

Thread ID:

Created:

Updated:

Platform:

Replies:

127585 Nov 25,2016 03:37 AM Nov 28,2016 07:21 AM ASP.NET Web Forms 1
loading
Tags: Grid
GUYOT
Asked On November 25, 2016 03:37 AM

Hello,

i need to edit text field with a multiline textbox. How can i do to make it in a grid ?

Thank you

Prasanna Kumar Viswanathan [Syncfusion]
Replied On November 28, 2016 07:21 AM

Hi Nicolas, 

Thanks for contacting Syncfusion support. 

To have multiline input text box in editing,  use textarea html control in the inline editing of grid. It is achieved by the editTemplate property.  

In EditTemplate Create event we will create the textarea element for CustomerID column. 
 
Find the code example, screenshot and sample:  
 
 
<ej:Grid ID="Grid" runat="server" AllowPaging="True"> 
        <Columns> 
                --------------------------------- 
               <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="90"> 
                    <ValidationRule> 
                        <ej:KeyValue Key="required" Value="true" /> 
                    </ValidationRule> 
                    <EditTemplate Create="create" Read="read" Write="write" /> 
                </ej:Column> 
                --------------------------------- 
         <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"></EditSettings> 
          <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> 
        </ej:Grid>  
<script type="text/javascript"> 
   function create() { 
        return "<textarea class='text' rows='4' cols='50'>{{:CustomerID}}</textarea>"; 
    } 
 
    function read(args) { 
        return args.val(); 
    } 
    function write(args) { 
        args.element.css("width", "100%"); 
    }</script> 
</asp:Content> 
 
 
Screenshot:  
 
 
 

Refer to the Help document for the editTemplate. 


Regards, 
Prasanna Kumar N.S.V 


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.

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.

;