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

ComboBox for Grid?

I need to use a ComboBox in the grid as opposed to a DropDownList (Though the user will usually choose from the list, they need to be able to enter free form text).  How is this accomplished using inline editing in the Grid?


1 Reply

MS Mani Sankar Durai Syncfusion Team January 4, 2017 11:15 AM UTC

Hi Michael, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and based on your requirement we have prepared a sample that can be downloaded from the below link. 

In this sample we have achieved your requirement by using EditTemplate property of columns in grid. In EditTemplate we have rendered Autocomplete control. Also we have enabled the property as showPopupButton to view it as dropdown. 

Please refer the below code example. 

            .Columns(col => 
            {               ... 
                col.Field("CustomerID").HeaderText("CustomerID").EditTemplate(a => { a.Create("create").Read("read").Write("write"); }).Width(100).Add(); 
<script type="text/javascript"> 
    function create() { 
        return $("<input>"); 
    function write(args) { 
        obj = $('#FlatGrid').ejGrid('instance'); 
        var data = ej.DataManager(obj.model.dataSource).executeLocal(new ej.Query().select("CustomerID")); 
        args.element.ejAutocomplete({ width: "100%", dataSource: data,showPopupButton: true , enableDistinct: true, value: args.rowdata !== undefined ? args.rowdata["CustomerID"] : "" }); 
    function read(args) { 
        return args.ejAutocomplete("getValue"); 

Also please refer the documentation link. 

Online sample link about EditTemplate, 

Please let us know if you need further assistance. 

Manisankar Durai. 

Live Chat Icon For mobile
Up arrow icon