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

SelectItemByValue does not work when using the WebApiAdaptor

Thread ID:





125549 Aug 24,2016 10:16 AM UTC Aug 25,2016 12:00 PM UTC JavaScript 1
Tags: ejDropDownList
Mahindra Morar
Asked On August 24, 2016 10:16 AM UTC

I am developing a MVC5 web application and  populating a dropdownlist control  using the WebApiAdaptor to make a REST call. 
When I try and select an item it does not select it.

Below is the code I am using to populate and select a value in the dropdown control.

//Page loaded
    $(function ()
            dataSource: ej.DataManager({
                url: "GetStatusType",                
                adaptor: new ej.WebApiAdaptor()
            fields: { text: "Name", value: "Code" }            

Are you able to tell me where I am going wrong?


Keerthana Rajendran [Syncfusion]
Replied On August 25, 2016 12:00 PM UTC

Hi Mahindra  
We had checked your code. We found that you have tried to select an item by value before data has been bound to dropdownlist. We suggest you to use this selectItemByValue in actionComplete event which will be triggered after data is bound to dropdownlist.   
$(function() {   
            dataSource: ej.DataManager({   
                url: "/api/Orders",   
                adaptor: new ej.WebApiAdaptor()   
            fields: {   
                text: "CustomerID",   
                value: "CustomerID"   
                var ddlobj = $("#drpStatus").data("ejDropDownList")   
We have prepared a sample please find in the below link.  
Please let us know if any concern   



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

or the page will be automatically redirected to 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