Hi
I have a grid and a 5 kendoComboBox combobox on a form
When the user selects an item from the grid, I am setting the value of kendo Combobox based on the values that were in the grid row.
i tried
here is my code
var urlcountry = '@Url.Action("GetGeoGroupCountry", "GeoGroupPostalCode")';
$.ajax({
url: urlcountry,
success: function (result) {
debugger;
var countryCombo = $("#GeoGroupCountryId").data("kendoComboBox");
countryCombo.dataSource.add(result);
countryCombo.select(function (dataItem) {
//dataItem argument is a ComboBox data item.
return dataItem.Text === e.sender.dataSource._data[0].GeoGroupCountryName;
});
// e.sender.dataSource._data[0].GeoGroupCountryName) is 'United States of America'
The same no result
// $.each(countryCombo.dataSource._data, function (key, value) {
// if (value.Text == e.sender.dataSource._data[0].GeoGroupCountryName) {
// countryCombo.select(key);
// return;
// }
// });
},
Thanks
I have a grid and a 5 kendoComboBox combobox on a form
When the user selects an item from the grid, I am setting the value of kendo Combobox based on the values that were in the grid row.
i tried
// selects item if its text is equal to "test" using predicate function
combobox.select(function(dataItem) {
return dataItem.text === "test";
});
with no result here is my code
var urlcountry = '@Url.Action("GetGeoGroupCountry", "GeoGroupPostalCode")';
$.ajax({
url: urlcountry,
success: function (result) {
debugger;
var countryCombo = $("#GeoGroupCountryId").data("kendoComboBox");
countryCombo.dataSource.add(result);
countryCombo.select(function (dataItem) {
//dataItem argument is a ComboBox data item.
return dataItem.Text === e.sender.dataSource._data[0].GeoGroupCountryName;
});
// e.sender.dataSource._data[0].GeoGroupCountryName) is 'United States of America'
The same no result
// $.each(countryCombo.dataSource._data, function (key, value) {
// if (value.Text == e.sender.dataSource._data[0].GeoGroupCountryName) {
// countryCombo.select(key);
// return;
// }
// });
},
Thanks