PDA

View Full Version : ComboBox ListItem Selected



Timothy
Aug 22, 2008, 3:25 PM
Hello,



<form id="Form1" runat="server">
<asp:ScriptManager runat="server" EnablePartialRendering="True" />
<ExtJS:ScriptManager ID="ScriptManager1" runat="server" StateProvider="PostBack" Theme="Gray" />
<ExtJS:ComboBox ID="drpComboBox" runat="server" Editable="False" ForceSelection="True" Mode="Local" TypeAhead="False" Select&#111;nfocus="True" TriggerAction="All" Width="255">
<Items>
<asp:ListItem Text="1" Value="1" Selected="True" />
<asp:ListItem Text="2" Value="2" />
<asp:ListItem Text="3" Value="3" />
<asp:ListItem Text="4" Value="4" />
<asp:ListItem Text="5" Value="5" />
<asp:ListItem Text="6" Value="6" />
<asp:ListItem Text="7" Value="7" />
</Items>
</ExtJS:ComboBox>
<ExtJS:Button ID="btnUpdate" runat="server" &#111;nclick="btnUpdate_Click" Text="Update" />
<br />
<asp:Label ID="lblUpdate" runat="server" Text="Nadda" />
</form>


I would expect that the first item in the combobox would be selected?

Fails in IE6.0 and FF3.0.

Cheers,
Timothy

geoffrey.mcgill
Aug 22, 2008, 3:51 PM
The <ext:ComboBox> is still undergoing API changes.

At the moment, you should be able to set the Selected Item by setting the <SelectedItem> node. The following code demonstrates.

Example


<ext:ComboBox
ID="drpComboBox"
runat="server"
Editable="False"
ForceSelection="True"
Mode="Local"
TypeAhead="False"
Select&#111;nfocus="True"
TriggerAction="All"
Width="255">
<SelectedItem Value="1" />
<Items>
<asp:ListItem Text="1" Value="1" />
<asp:ListItem Text="2" Value="2" />
<asp:ListItem Text="3" Value="3" />
<asp:ListItem Text="4" Value="4" />
<asp:ListItem Text="5" Value="5" />
<asp:ListItem Text="6" Value="6" />
<asp:ListItem Text="7" Value="7" />
</Items>
</ext:ComboBox>

Expect the above code to change before v0.6 is released.