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

Default Value for Dropdown in JavaScript grid

Thread ID:





120552 Sep 24,2015 08:37 PM UTC Sep 25,2015 08:38 AM UTC JavaScript 1
Tags: ejGrid
Mike Rosenberger
Asked On September 24, 2015 08:37 PM UTC

I am trying to set the defualt value for a a Dropdown when adding a new row. However it doesn't select anything from the dropdown, is there a differant way i should be approaching this.

//Here is the datasource 
var dateUnit= [
            { text: "Hours", value:1 },
                { text: "Days", value: 2},

//Here is the column portion
columns: [
                        { field: "Unit", headerText: "Unit", textAlign: ej.TextAlign.Center, editType: ej.Grid.EditingType.Dropdown, dataSource: dateUnit, defaultValue: 1 }

Saravanan Arunachalam [Syncfusion]
Replied On September 25, 2015 08:38 AM UTC

Hi Mike,

Thanks for contacting Syncfusion Support.

We analyzed your query and we considered this query “Dropdown edit with defaultValue is not working” as a bug and a support incident has been created under your account to track the status of this issue. Please log on to our support website to check for further updates.


And also we have resolved the issue using a workaround. In the workaround, we have achieved your requirement using “actionComplete” event of Grid and we have set the default value using “setSelectedValue” method of DropDownList. Please refer to the following code example.


                . . .                                         

              actionComplete: function(args){

                                                                if(args.requestType == "add"){

                                                                                var drpdwn = this.getContentTable(".gridfrom").find("#GridEmployeeID").ejDropDownList("instance");




             . . .


We have created the sample and it can be downloaded from the following link:





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