Textbox in grid always

Hi, 
I am trying to create a cell which will always have a textbox in it, this is to allow data entry. I have done some searches but havent came across anything to allow this. Is it possible to do this with a Grid?

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team October 10, 2017 05:09 AM UTC

Hi Ryan,  
 
Thanks for contacting Syncfusion Support.  
 
Grid Provides an option place an any element in the Grid cells using the Template feature of the Column property. Refer to the following the Help Document.  
 
 
Using this, we can place a textbox in the Grid cells as shown in the following code example.  
 
<script type="text/x-jsrender" id="columnTemplate"> 
    <input type="text" value="{{:EmployeeID}}"> 
</script> 
 
    <ej:Grid ID="FlatGrid" runat="server" AllowPaging="True"> 
        <Columns> 
            <ej:column headertext="Input" Template="#columnTemplate" TextAlign="Center" /> 
        </Columns> 
    </ej:Grid> 
 
 
 
If you would like to update any changes on the demand, you can use the TemplateRefresh event.  
 
 
 
<script type="text/x-jsrender" id="columnTemplate"> 
    <input type="text" value="{{:EmployeeID}}"> 
</script> 
 
    <ej:Grid ID="FlatGrid" runat="server" AllowPaging="True"> 
        <Columns> 
            <ej:column headertext="Input" Template="#columnTemplate" TextAlign="Center" /> 
        </Columns> 
           <ClientSideEvents TemplateRefresh ="templateRefresh" /> 
    </ej:Grid> 
 
<script> 
    function templateRefresh(args){ 
        //do some changes using args 
    } 
</script> 
 
Regards,  
Seeni Sakthi Kumar S. 
 


Loader.
Up arrow icon