Hello Friends I am using a list box control in aspx page
i have set multiple selection property to true, but when i try to select more than one item
it does not select multiple items, it selects one only do i have to do something programatically here is my code
<html>
<form id="form1" runat="server">
<div>
<asp:ListBox ID="ListBox1" runat="server"
SelectionMode="Multiple">
<asp:ListItem Text="hi" Value="hi"></asp:ListItem>
<asp:ListItem Text="hi" Value="hi"></asp:ListItem>
<asp:ListItem Text="hi" Value="hi"></asp:ListItem>
<asp:ListItem Text="hi" Value="hi"></asp:ListItem>
</asp:ListBox>
</div>
</form>
</html>
on code behind nothing …i want why it is not selecting more than one item’s ..
i am using namespace using System.Web.UI.WebControls; as well but of no avail..
Here is the doc link with examples of use:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.listbox.aspx
To select multiple items in your dropdown, ensure you use the ctrl key and click the items you want. You may need to change the size of the dropdown (so that it shows more than one item at a time) to see this more easily.
I’d start with the second example on the link as that is an example of what you are trying to do (usage wise).