or
<tr> <td valign="top" colspan="2"> <div style="float: left"> <em>*</em> @Html.LabelFor(model => model.CountryId) <br /> @Html.Kendo().DropDownListFor(model => model.CountryId).BindTo(Model.AvailableCountries).Animation(true).HtmlAttributes(new { onchange = "populateState(this)", style = "width:250px;" }) <span id="states-loading-progress" style="display: none;">Wait... <img src='@Url.Content("~/Content/Images/ajax_loader_small.gif")' alt="Wait..." /> </span> </div> <div style="float: right"> @Html.LabelFor(model => model.PostalCode) <br /> @Html.TextBoxFor(model => model.PostalCode, new { @class = "k-textbox", style = "width:100px;" }) </div> </td> </tr> <tr> <td valign="top">@Html.LabelFor(model => model.State) <br /> <div id="ddlStates"> @(Html.Kendo().DropDownList() .Name("State") // .OptionLabel("Select state...") .DataTextField("name") .DataValueField("id") .DataSource(source => { source.Read(read => { read.Route("GetStatesByCountryId") .Data("CountryId") .Type(HttpVerbs.Post); // This line serves to accept POST requests }) .ServerFiltering(true); }) .Enable(false) .AutoBind(false) .CascadeFrom("CountryId") )$("#myGrid").data("kendoGrid") .dataSource.transport.parameterMap = function (data, operation) { return $.extend(data, { myCustomData: true //Actually client-side calculated data, not static }); };
[Display(Name = "Owner Id")][UIHint("CustomersAllDDLEditor")]public Nullable<int> OwnerId { get; set; }public class ItemViewModel { public Item Item { get; set; } public ItemOptionsViewModel DDLOptions { get; set; } public AuditStampsViewModel AuditStamps { get; set; } }@(Html.Kendo().DropDownList() .Name("Item.OwnerId") .DataValueField("Id") .DataTextField("DisplayName") //.BindTo(Model.DDLOptions.CustomerOptions) .BindTo((System.Collections.IEnumerable)ViewData["customers"]) .OptionLabel(" ") .Template("#= data.DisplayName.replace(' ', ' ') #"))@Html.EditorFor(model => model.Item.OwnerId)<input data-val="true" data-val-number="The field Owner Id must be a number." id="Item_OwnerId" name="Item.OwnerId" type="text" value="3" class="k-input valid" data-role="dropdownlist" style="display: none;"><input id="Item_OwnerId" name="Item.OwnerId" type="text" class="k-input valid" data-role="dropdownlist" style="display: none;">