Thanks for using Syncfusion products.
We would like to let you know that as per our current implementation, when we specify celledit type as dropdownlist, we used to display distinct values in the dropdown. If you need to specify your own custom values in dropdown, we suggest you to refer to the below code snippet.
[Script]
<%=Html.Syncfusion().Grid<EditableOrder>("SampleGrid")
.ClientSideEvents(events =>
{
events.OnRecordEdit("SetdropDownData");
})
%>
[Script]
function SetdropDownData(sender, args) {
$.ajax({
type: "POST",
url: "Editing/GetCountries",
dataType: "json",
success: function (data) {
$("#ShipCountry option").remove();
$.each(data, function (index, val) {
var optionTag = $("<option></option>");
$(optionTag).val(val.Value).text(val.Text);
$("#ShipCountry").append(optionTag);
});
$("#ShipCountry").val(selectedCountry);
}
});
}
[Controller]
public ActionResult GetCountries()
{
return Json(CountryList, JsonRequestBehavior.AllowGet);
}
public IEnumerable<SelectListItem> CountryList
{
get
{
List<SelectListItem> type = new List<SelectListItem>();
type.Add(new SelectListItem
{
Selected = true,
Text = "Switzerland",
Value = "Switzerland"
});
type.Add(new SelectListItem
{
Text = "Brazil",
Value = "Brazil"
});
type.Add(new SelectListItem
{
Text = "Germany",
Value = "Germany"
});
type.Add(new SelectListItem
{
Text = "Mexico",
Value = "Mexico"
});
type.Add(new SelectListItem
{
Text = "USA",
Value = "USA"
});
type.Add(new SelectListItem
{
Text = "Spain",
Value = "Spain"
});
return type;
}
}
Sample link: Sample.zip
Please let us know if you have any concern.
Regards,
Ranjithkumar.