Change dropdownlist when another dropdownlist selected

Hi ,

I have a 2 table  : 

Table A : IdA,NameA
Table B :IdB,IdA,NameB

I create 2 dropdownlist A,B in MVC. I want to change dropdownlist B when dropdownlist A selected .

Thank you.

1 Reply

KR Keerthana Rajendran Syncfusion Team November 27, 2017 10:50 AM UTC

Hi Ken, 
 
Thank you for contacting Syncfusion support. 
 
We can change dropdownlist B when items in Dropdownlist A is selected by using cascadeTo property as shown below 
 
<div class="control" style="float: left;"> 
            <span class="txt">Select Group</span> 
            @Html.EJ().DropDownList("groupsList").Datasource((IEnumerable<groups>)ViewBag.datasource).DropDownListFields(f => f.Value("parentId").Text("text")).CascadeTo("countryList").EnableRTL(false) 
        </div> 
        <div class="control" style="float: left;"> 
            <span class="txt">Select Country</span> 
            @Html.EJ().DropDownList("countryList").Datasource((IEnumerable<Countries>)ViewBag.datasource1).Enabled(false).EnableRTL(false) 
        </div> 
 
Here, items in second dropdownlist will be selected based on the value “parentId” chosen in first Dropdownlist.  
 
We have attached a sample for reference which can be downloaded from the  below link: 
 
 
Also, refer to the below links for more details 
 
 
 
Regards, 
Keerthana. 


Loader.
Up arrow icon