<h3>Choisissez le mois</h3> <input id="input" placeholder="Select fabric..." /> <button class="k-button" id="valid">Valider</button> <script> $(document).ready(function() { // create ComboBox from input HTML element $("#input").kendoComboBox({ dataTextField: "text", dataValueField: "value", dataSource: [ { text: "Janvier", value: "1" }, { text: "Février", value: "2" }, { text: "Mars", value: "3" }, { text: "Avril", value: "4" }, { text: "Mai", value: "5" }, { text: "Juin", value: "6" }, { text: "Juillet", value: "7" }, { text: "Août", value: "8" }, { text: "Septembre", value: "9" }, { text: "Octobre", value: "10" }, { text: "Novembre", value: "11" }, { text: "Décembre", value: "12" } ], filter: "contains", suggest: true, index: 0 }); // create ComboBox from select HTML element $("#select").kendoComboBox(); var input = $("#input").data("kendoComboBox"); $("#valid").click(function() { $.get("data/fetch.php", { mois:input.value()} ); alert(input.value()) }); }); </script>::Edited :: Solved by changing Inherits="System.Web.Mvc.ViewPage<MVC3TelerikDemo.Models.Department>"
To
Inherits="System.Web.Mvc.ViewPage<IEnumerable<MVC3TelerikDemo.Models.Department>>"
Hi,
I am new with Telerik and trying to bind Linq.Table to the Kendo Dropdown. Following is the code.
-------Action Method---------
public ActionResult DropDownList()
{
DepartmentsDataContext context = new DepartmentsDataContext();
return View(context.Departments);
}
--------View Page--------
<%: Html.Kendo().DropDownList()
.Name("ddlDept")
.DataTextField("Name")
.DataValueField("DepartmentID")
.BindTo(Model)
.SelectedIndex(0)
%>
I get the following error: CS1502: The best overloaded method match for 'Kendo.Mvc.UI.Fluent.DropDownListBuilder.BindTo(System.Collections.Generic.IEnumerable<Kendo.Mvc.UI.DropDownListItem>)' has some invalid arguments
Thank you.
Yeou
$("#combo").kendoComboBox({ filter: "contains" });