user6672226 user6672226 - 1 year ago 125
ASP.NET (C#) Question

Set the returned data to Kendo Dropdownlist

I am working in ASP.Net MVC. I have a dropdownlist of Kendo and a form to insert data to database and set the recently inserted data to be selected on kendo dropdown.I am using angular for post method.

var response = $http({
method: "post",
url: loadAllProductsUrl,
data: JSON.stringify(customerdetail),
dataType: "json",
async: false

return response.then(function (data) {
if (data != null) {

else {


This is my Post method and from here I return the Customer Code and set it to the kendo dropdownlist.

function setToDropdown(data) {

var temp = $("#customers").data("kendoDropDownList"); (dataItem) {
return dataItem.CustomerCode === data;

But the data is not being set to the dropdownlist because setToDropdown(data) is executed before $("#customers").data("kendoDropDownList"); is loaded fully. Please suggest....

Answer Source

this helped me

 getCustomer(function (a) {

                            setTimeout(function () {

                            }, 100);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download