Hi,
I have a scenario, where I have two drop-downs that I want to cascade. This is working to an extent, but when I want to expand the functionality to bind intially to a model list, then select a value on page load, I can't think of a way to make this happen.
These are the two drop-downs:
And
I have a scenario, where I have two drop-downs that I want to cascade. This is working to an extent, but when I want to expand the functionality to bind intially to a model list, then select a value on page load, I can't think of a way to make this happen.
These are the two drop-downs:
Html.Kendo().DropDownListFor(c => c.SelectedGroup)
.BindTo(Model.Groups)
.Value(Model.SelectedGroup.Value.ToString())
.HtmlAttributes(new { style = "width: 250px" })
.Render();
@(Html.Kendo().DropDownListFor(t => t.AuthorisedByExtraID)
.DataTextField("Name")
.DataValueField("ExtraUserID")
.DataSource(source =>
source.Read(read => read.Action("SearchAutocompleteEmployees", "Search")
.Data("onAutoCompleteAdditional")
.Type(HttpVerbs.Post))
.ServerFiltering(true))
.HtmlAttributes(new { style = "width: 250px" })
.Enable(false)
.AutoBind(true)
.BindTo(Model.GroupEmployees)
.Value(Model.AuthorisedByExtraID.HasValue ? Model.AuthorisedByExtraID.Value.ToString() : "0")
.CascadeFrom("SelectedGroup")
)
How can I enable the second drop-down to bind to Model.AuthorisedByExtraID when it exists, then when group changes, to load the contents via ajax? Thanks, Gabor