Jan 23, 2010, 2:22 PM
Wrong default value in comboBox?
My problem is that when I select a country for the first time the states comboBox shows the number "1" which is the country "ID", and the states list of the states when I click the comboBox is ok.
My question it is why the value "1" is setted by defaut when I select the country?
I have the following code to retrieve the states when a country is selected:
My question it is why the value "1" is setted by defaut when I select the country?
I have the following code to retrieve the states when a country is selected:
protected void ComboBoxContrySelect(object sender, AjaxEventArgs e)
{
string id = this.ComboBoxBILLINGCOUNTRYIDField.SelectedItem.Value.ToString();
this.ObjectDataSourceComboBoxFechStateForCountry.SelectParameters["COUNTRYID"].DefaultValue = id;
this.StoreComboBoxState.DataBind();
}
And the following are the fields:<ext:FormLayout ID="FormLayout7" runat="server" LabelAlign="Top">
<ext:Anchor Horizontal="80%">
<ext:ComboBox
ID="BILLINGCOUNTRYIDField"
StoreID="StoreComboBoxCountry"
runat="server"
Editable="false"
ValueField="ID"
DisplayField="NAME"
FieldLabel="Country">
<AjaxEvents>
<select OnEvent="ComboBoxContrySelect"/>
</AjaxEvents>
</ext:ComboBox>
</ext:Anchor>
<ext:Anchor Horizontal="80%">
<ext:ComboBox
ID="BILLINGREGION2IDField"
runat="server"
FieldLabel="State"
StoreID="StoreComboBoxState"
EmptyText="Select a state..."
ValueField="ID"
DisplayField="NAME"
ForceSelection="true"
/>
</ext:Anchor>
Thanks,