ComboBox ListItem Selected

  1. #1

    ComboBox ListItem Selected

    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
  2. #2

    RE: ComboBox ListItem Selected

    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.

    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] ComboBox empty ListItem
    By methode in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 18, 2013, 4:01 AM
  2. [CLOSED] Adding extra listitem at top combobox
    By CarWise in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 29, 2012, 10:57 AM
  3. [CLOSED] ext:ComboBox ListItem with html image tag
    By supera in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 02, 2012, 12:58 PM
  4. Replies: 4
    Last Post: Sep 28, 2011, 8:57 AM
  5. Replies: 0
    Last Post: May 30, 2010, 10:24 PM

Posting Permissions