This is a migrated thread and some comments may be shown as answers.

[Solved] Showing all the values in child dropdown

0 Answers 10 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Supriya
Top achievements
Rank 1
Supriya asked on 03 Dec 2012, 04:02 PM
I have 2 dropdowns, Region and Country where country is loaded dynamically when Region is selected. This works but I need, as a default case, Country (child) Dropdown should always be enabled and populated with all the values when no Region is selected so that I can select any country without selecting a region.

Here is my code so far -
@(Html.Telerik().DropDownList().Name("Region")
       .DataBinding(binding => binding.Ajax()
       .Select("_GetRegions", "PerDiem"))
       .HtmlAttributes(new { style = "width:200px;", data_bind = "value:region" })
       .DropDownHtmlAttributes(new { style = "text-align:left" })
       .Placeholder("All")
       .CascadeTo("Country")
       .SelectedIndex(0)
       )

@(Html.Telerik().DropDownList().Name("Country")
        .DataBinding(binding => binding.Ajax()
        .Select("_GetCountries", "PerDiem"))
        .Placeholder("All")
        .SelectedIndex(0)
        )
Tags
ComboBox
Asked by
Supriya
Top achievements
Rank 1
Share this question
or