Hi
i am using linked combos for Country ,state and City like Sample code shown below. There is no problem loading the page but when we need fill combo with the previous values in update mode only country's Combo is working properly and state,s combo and city's combo do not have the correct selected index value(The first item in the list is selected) Of course the list of cities and provinces is correct.

for example we select Brazil for country and Goias for state and Cacu for city but in update mode when i use SetValueAndFireSelect combo fill with Brazil for country Acre for state and Abadiania for city.
acre is first in list of states of brazil and Abadiania is first of city of Goias .list is correct but selected index is not


                             Html.X().ComboBox()
                                      .ID("ComboBoxCountry")
                                      .TypeAhead(true)
                                      .QueryMode(DataLoadMode.Local)
                                      .TriggerAction(TriggerAction.All)
                                      .DisplayField("name")
                                      .ValueField("code")
                                      .EmptyText("select a Country")
                                      .Listeners(ls =>
                                          ls.Select.Handler = "App.ComboBoxState.clearValue(); App.ComboBoxState.getStore().load()"
                                      )
                                      .Store(Html.X().Store()
                                          .Model(Html.X().Model()
                                              .IDProperty("Id")
                                              .Fields(
                                                  new ModelField("id", ModelFieldType.String) { Mapping = "Id" },
                                                  new ModelField("name", ModelFieldType.String) { Mapping = "Name" }
                                                  , new ModelField("code", ModelFieldType.String) { Mapping = "code" }
                                              )
                                          )
                                          .Proxy(Html.X().AjaxProxy()
                                              .Url(Url.Action("GetCountry"))
                                              .Reader(Html.X().JsonReader().RootProperty("data"))
                                          )
                                      ),
                                  Html.X().ComboBox()
                                      .ID("ComboBoxState")
                                      .TypeAhead(true)
                                      .QueryMode(DataLoadMode.Local)
                                      .TriggerAction(TriggerAction.All)
                                      .DisplayField("name")
                                      .ValueField("code")
                                      .Listeners(ls =>
                                          ls.Select.Handler = "App.ComboBoxCities.clearValue(); App.ComboBoxCities.getStore().load()"
                                      )
                                 
                                      .Store(Html.X().Store()
                                          .AutoLoad(false)
                                          .Model(Html.X().Model()
                                              .IDProperty("Id")
                                              .Fields(
                                                  new ModelField("id", ModelFieldType.String) { Mapping = "Id" },
                                                  new ModelField("name", ModelFieldType.String) { Mapping = "Name" }
                                                  , new ModelField("code", ModelFieldType.String) { Mapping = "code" }
                                              )
                                          )
                                          .Proxy(Html.X().AjaxProxy()
                                              .Url(Url.Action("Getstate"))
                                              .Reader(Html.X().JsonReader().RootProperty("data"))
                                          )
                                          .Parameters(ps =>
                                              ps.Add(new StoreParameter("country", "App.ComboBoxCountry.getValue()",ParameterMode.Raw)) 
                                          )
                                          .Listeners(ls =>
                                              ls.Load.Handler = @"var combo = 
                                            App.ComboBoxState;combo.setValue(records[0].get(combo.valueField));"
                                          )
                                      )
                                  ,
                                  Html.X().ComboBox()
                                      .ID("ComboBoxCities")
                                      .TypeAhead(true)
                                      .Scrollable(ScrollableOption.Vertical)
                                      .QueryMode(DataLoadMode.Local)
                                      .TriggerAction(TriggerAction.All)
                                      .DisplayField("name")
                                      .ValueField("id")
                                      .Store(Html.X().Store()
                                          .AutoLoad(false)
                                          .Model(Html.X().Model()
                                              .IDProperty("Id")
                                              .Fields(
                                                  new ModelField("id", ModelFieldType.String) { Mapping = "Id" },
                                                  new ModelField("name", ModelFieldType.String) { Mapping = "Name" }
                                                  , new ModelField("code", ModelFieldType.String) { Mapping = "code" }
                                              )
                                          )
                                          .Proxy(Html.X().AjaxProxy()
                                              .Url(Url.Action("GetCity"))
                                              .Reader(Html.X().JsonReader().RootProperty("data"))
                                          )
                                          .Parameters(ps =>
                                              ps.Add(new StoreParameter("State", "App.ComboBoxState.getValue()", ParameterMode.Raw))
                                          )
                                          .Listeners(ls =>
                                              ls.Load.Handler = @"var combo = App.ComboBoxCities;
                    combo.setValue(records[0].get(combo.valueField));"
                                          )
                                      )
and in server side:

 this.GetCmp<ComboBox>("ComboBoxCountry").SetValueAndFireSelect(ad.Country);
 this.GetCmp<ComboBox>("ComboBoxState").SetValueAndFireSelect(ad.State);
 this.GetCmp<ComboBox>("ComboBoxCities").SetValueAndFireSelect(ad.City);
Thank you for telling me which part of my code is wrong