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

Grid will not manually populate value set as dropdownedit

Thread ID:





143446 Mar 20,2019 01:01 PM UTC Mar 21,2019 08:45 AM UTC JavaScript - EJ 2 3
Tags: Grid
Asked On March 20, 2019 01:01 PM UTC


I need to manually set the values of the dropdown in an editable Grid. These are hardcoded values and will not come from the database. I am currently setting the code like this:

                        field: 'Currency',
                        width: 200,
                        params: {
                            dataSource: [{ text: 'USD' }, { text: 'GBP' }, { text: 'EUR' }],
                        editType: 'dropdownedit', 
                        headerText: 'Currency'


However the drop-down is just empty.

See video for replicated problem: http://www.youtube.com/watch?v=zt5lmckCvEk



Thavasianand Sankaranarayanan [Syncfusion]
Replied On March 21, 2019 06:49 AM UTC

Hi Craig, 

Greetings from Syncfusion. 

Based on your query we suspect that you want to apply dataSource for the dropdown in Grid’s column. So, we suggest you to follow the below code example to achieve your requirement. 

    var data = [{OrderID: 10248, CustomerID: "VINET", Freight: 32.38, Currency: 'USD'}, {OrderID: 10249, CustomerID: "TOMSP", Freight: 11.61, Currency:'USD'}]; 
    var grid = new ej.grids.Grid({ 
        dataSource: data, 
        editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, mode: 'Normal', newRowPosition:'Top' }, 
        toolbar: ['Add', 'Edit', 'Delete', 'Update', 'Cancel'], 
        columns: [ 
                field: 'OrderID', isPrimaryKey: true, headerText: 'Order ID', textAlign: 'Right', 
                validationRules: { required: true, number: true }, width: 140 
                field: 'CustomerID', headerText: 'Customer ID', 
                validationRules: { required: true }, width: 140 
                field: 'Freight', headerText: 'Freight', textAlign: 'Right', editType: 'numericedit', 
                width: 140, format: 'C2', validationRules: { required: true } 
                field: 'Currency',  editType: 'dropdownedit', width: 150, 
                edit: {  
                   params: {  
                       query: new ej.data.Query(),   
                       dataSource: [{ text: 'USD' }, { text: 'GBP'}, { text: 'EUR'}], 

We have prepared a simple sample in the following stackblitz link. 

Refer the help documentation. 

Thavasianand S. 

Replied On March 21, 2019 07:22 AM UTC

That resolved the issue. I hadn't wrapped the params object inside an edit object

Thavasianand Sankaranarayanan [Syncfusion]
Replied On March 21, 2019 08:45 AM UTC

Hi Craig, 
We are happy that the problem has been solved. 
Please get back to us if you need any further assistance.  
Thavasianand S.


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

Live Chat Icon For mobile
Live Chat Icon