Anokrize Anokrize -4 years ago 231
ASP.NET (C#) Question

Telerik Grid Custom Dropdown doesn't take value

I am having a problem setting up my Telerik KendoUI Grid for MVC.
Inside my grid I have linked up a custom kendo DropDownList.

The list looks like this:

.BindTo(new List<SelectListItem>() {
new SelectListItem()
Text = "A",
Value = "Anrufen"
new SelectListItem()
Text = "BT",
Value = "nächster Beratungstermin"
new SelectListItem()
Text = "PT",
Value = "Probetraining"
new SelectListItem()
Text = "V",
Value = "Verloren"

I bound it to the Telerik Grid Column like that:

columns.Bound(product => product.Aktion).EditorTemplateName("AktionTemplate").Title("Ergebnis");

Everythin works fine and the DropDown list gets displayed except that the grid doesn't take the value from the selected list element.

When I select anything from the dropdown and trying to save it, then there is no value, it is null.


public ActionResult Details(int id)
KundeContext kundeContext = new KundeContext();
var result = kundeContext.Kundes.Where(x => x.KdNr == id).FirstOrDefault();

return View(result);

Calling Method(AngularJS):

$scope.Select = function (x) {
window.location = "http://localhost:50380/Kunde/Details/" + x;

Answer Source

From Documentation on Editor Templates.

The name of the widget should be the same as the name of the property.

Try changing the Name property of your dropdownlist to 'Aktion' instead of 'Ergebnis'.

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