This question is locked. New answers and comments are not allowed.
I'm having issues Databinding to my DropDownList. My Grid is working fine. My DropDownList on the otherhand,
I would like to populate with AmenityTypes.
[AmenityController]
[HttpPost]
public ActionResult _AjaxBinding(string text)
{
Mvc.Models.AmenityType.AmenityTypeModel _amenityTypes = new Models.AmenityType.AmenityTypeModel();
_amenityTypes.AmenityTypesList = Mvc.Models.AmenityType.Repository.AmenityTypeMethods.GetAmenityTypes();
return new JsonResult { Data = new SelectList(_amenityTypes.AmenityTypesList) };
}
[View]
<div class="fl"> @(Html.Telerik().DropDownList() .DataBinding(dataBinding => dataBinding .Ajax() .Select("_AjaxBinding", "Amenity")) </div> <div class="clr pt5"> <!-- list --> @(Html.Telerik().Grid(Model.AmenityList) .DataKeys(k => k.Add(o => o.AmenityID)) .DataBinding(dataBinding => dataBinding .Ajax() .Select("Index", "Home") //.Insert("Insert", "Grid") //.Update("Update", "Grid") //.Delete("DeleteAmenity", "PropertyAmenitListGrid")) .Delete("DeleteAmenity", "Amenity")) .Name("PropertyAmenitListGrid") .Scrollable() .Pageable() .Selectable() .Columns(col => { col.Bound(c => c.Name); col.Command(commands => { commands.Delete(); }).Width(100); }) ) @Html.HiddenFor(x => x.PropertyID) </div>