Apr 01, 2010, 8:05 AM
[CLOSED] Why does combobox text get overwritten by the value while I set the selected item text?
I have a combobox which allows me to choose a country. Its value is an ID. The item that is selected by default is set using the SelectedItem node (I do that because the lookup store is not autoloading so the country name is not available until the combobox is expanded).
However, the combobox text gets overwritten by the ID after the main store (from which the combobox gets the selected country ID) is loaded. How do I fix that?
However, the combobox text gets overwritten by the ID after the main store (from which the combobox gets the selected country ID) is loaded. How do I fix that?
<ext:ComboBox ID="BillingAddressCountryComboBox" runat="server" StoreID="CountryLookupStore" HiddenName="BillingAddressCountryId" DataIndex="BillingAddressCountryId" DisplayField="Name" ValueField="Id" ItemSelector="div.combo-search-item">
<Template runat="server">
<Html>
<tpl for=".">
<div class="combo-search-item">
<div class="name">{Name}
</tpl>
</Html>
</Template>
<SelectedItem Text='<%# Model.BillingAddressCountryName %>' AutoDataBind="true" />
</ext:ComboBox>