Dropdownlist control in update form

Hi support i've a problem with 4 dropdownlist in update form.
I fill my record in my controller and i've verified the record it's correctly filled.

There are my 4 dropdownlist
                                        <div class="form-group row">
                                            <div class="col-md-3">
                                                <label asp-for="CountryId">Nazione</label>
                                                <ej-drop-down-list id="countriesDropdown" ej-for="CountryId" watermark-text="Selezionare una nazione" query="ej.Query().where('EndDate', 'equal', null)"
                                                                   width="100%"  locale="it-IT" change="RegionsChange" action-complete="RegionsActionComplete"
                                                                   cascade-to="regionsDropdown" cascade="RegionsCascade">
                                                    <e-datamanager url="/Api/Countries/GetAll" adaptor="@AdaptorType.WebApiAdaptor"></e-datamanager>
                                                    <e-drop-down-list-fields text="CountryName" value="Id" />
                                                </ej-drop-down-list>
                                            </div>
                                            <div class="col-md-3">
                                                <label asp-for="RegionId">Regione</label>
                                                <ej-drop-down-list id="regionsDropdown" watermark-text="Selezionare una regione"
                                                                   width="100%" ej-for="RegionId" locale="it-IT"
                                                                   cascade-to="provincesDropdown" cascade="ProvincesCascade">
                                                    <e-datamanager url="/Api/Regions/GetAll" adaptor="@AdaptorType.WebApiAdaptor"></e-datamanager>
                                                    <e-drop-down-list-fields text="RegionName" value="Id" />
                                                </ej-drop-down-list>
                                            </div>
                                            <div class="col-md-3">
                                                <label asp-for="ProvinceId">Provincia</label>
                                                <ej-drop-down-list id="provincesDropdown" watermark-text="Selezionare una provincia" 
                                                                   width="100%" ej-for="ProvinceId" locale="it-IT"
                                                                   cascade-to="citiesDropdown" cascade="CitiesCascade">
                                                    <e-datamanager url="/Api/Provinces/GetAll" adaptor="@AdaptorType.WebApiAdaptor"></e-datamanager>
                                                    <e-drop-down-list-fields text="ProvinceName" value="Id" />
                                                </ej-drop-down-list>
                                            </div>
                                            <div class="col-md-3">
                                                <label asp-for="CityId">Comune</label>
                                                <ej-drop-down-list id="citiesDropdown" ej-for="CityId" watermark-text="Selezionare un comune" 
                                                                   width="100%" locale="it-IT">
                                                    <e-datamanager url="/Api/ItalianCities/GetAll" adaptor="@AdaptorType.WebApiAdaptor"></e-datamanager>
                                                    <e-drop-down-list-fields text="CityName" value="Id" />
                                                </ej-drop-down-list>
                                            </div>
                                       </div>

and the javascript to manage the the cascade

        function RegionsActionComplete(args) {
            if (args.model.text != 'ITALIA') {
                $("#regionsDropdown").data("ejDropDownList").disable();
                $("#provincesDropdown").data("ejDropDownList").disable();
                $("#citiesDropdown").data("ejDropDownList").disable();

            }

        }

        function RegionsCascade(args) {
            args.requiresDefaultFilter = false;
            args.cascadeQuery = ej.Query().where(ej.Predicate("CountryId", ej.FilterOperators.equal, args.cascadeValue, true)
                .and(ej.Predicate("EndDate", ej.FilterOperators.equal, null, true)));
        }

        function ProvincesCascade(args) {
            args.requiresDefaultFilter = false;
            args.cascadeQuery = ej.Query().where(ej.Predicate("RegionId", ej.FilterOperators.equal, args.cascadeValue, true)
                .and(ej.Predicate("EndDate", ej.FilterOperators.equal, null, true)));
        }

        function CitiesCascade(args) {
            args.requiresDefaultFilter = false;
            args.cascadeQuery = ej.Query().where(ej.Predicate("ProvinceId", ej.FilterOperators.equal, args.cascadeValue, true)
                .and(ej.Predicate("EndDate", ej.FilterOperators.equal, null, true)));
        }






The Nazione and Regione filelds are correctly filled but the Provincia and Citta in the model are filled but inside the selected valued of the dropdown list is not selected but in the list are present.

It's possible a synchro problem ?

Where i'm wrong ?

Thanks for your help 
Stefano Capobianco

1 Reply

KR Keerthana Rajendran Syncfusion Team December 26, 2017 04:11 PM UTC

Hi Stefano, 
 
Thanks for contacting Syncfusion support. 
 
We prepared a sample similar to your scenario. By default, model values are bound correctly to DropDownList and we suspect that the problem may be with the cascadeQuery passed during cascade event. We couldn’t reconstruct your query exactly with the provided code to validate the  issue. So, we request you to modify the attached sample based on your scenario to exhibit the issue or provide your own sample with necessary steps to replicate the issue at our end. it will help us isolate the immediate cause of the issue and provide you solution.  
 
Regards, 
Keerthana. 


Loader.
Up arrow icon