locked
With a combobox, how can I have the list items in the dropdownlist automaticaly display upon diplaying the combobox RRS feed

  • Question

  • User-858993849 posted

    I want to programmably have the items in a combobox show without having to click on it.  How can I do that (vb)

    Friday, July 11, 2014 10:09 AM

Answers

All replies

  • User2103319870 posted

    I want to programmably have the items in a combobox show without having to click on it.  How can I do that (vb)

    If you want to show all the items in a combobox with out clicking on it. then you can try using ListBox Control instead of combobox control

    Sample Code:

    <asp:ListBox ID="ListBox1" runat="server" SelectionMode="Multiple">
            <asp:ListItem Text="test1"></asp:ListItem>
            <asp:ListItem Text="test2"></asp:ListItem>
            <asp:ListItem Text="test3"></asp:ListItem>
        </asp:ListBox>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 11, 2014 11:59 PM
  • User-858993849 posted

    That's what I am using now. I was hoping I could do the same thing with the combobox

    Saturday, July 12, 2014 9:52 AM
  • User1918509225 posted

    Hi JAYHAWKER,

    please try the code below:

    <form id="form1" runat="server">
            <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
        <div>
            <ajaxToolkit:ComboBox ID="ComboBox1" runat="server">
                <asp:ListItem>A</asp:ListItem>
                 <asp:ListItem>B</asp:ListItem>
                 <asp:ListItem>C</asp:ListItem>
                 <asp:ListItem>D</asp:ListItem>
            </ajaxToolkit:ComboBox>
        </div>
        </form>

    Best Regards,

    Kevin Shen.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 14, 2014 4:54 AM
  • User-858993849 posted

    Thanks for trying. But I still have to click on it to get the items to display.

    Monday, July 14, 2014 7:39 AM