Click here to Skip to main content
15,895,480 members
Articles / Programming Languages / C#

Multiselect DropDown ListBox Control for Web Applications

,
Rate me:
Please Sign up or sign in to vote.
4.94/5 (14 votes)
3 Dec 2008CPOL5 min read 107.1K   3.1K   41  
Enables the user to select multiple options in a drop down
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="MultiselectDropDownListBox.ascx.cs"
    Inherits="Controls.MultiselectDropDownListBox" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<link media="all" href="Controls/CSS/MultiSelectListBox.css" type="text/css" rel="stylesheet">

<script language="javascript" src="Controls/Scripts/MultiSelectListBox.js"></script>

<asp:Panel ID="MSDDLB_pnl" BackColor="White" Width="186px" Height="0px" runat="server" HorizontalAlign="Left"> 
    <table id="MSDDLB_tbl" style="border-right: #6699ff 1px solid; table-layout: fixed;
        border-top: #6699ff 1px solid; border-left: #6699ff 1px solid; border-bottom: #6699ff 1px solid;
        height: 20px" cellspacing="0" cellpadding="0" width="100%" border="0" runat="server">
        <tr id="rowDD" style="height: 15px" runat="server">
            <td nowrap style="height: 15px; vertical-align: text-top;">
                <asp:TextBox ID="MSDDLB_txtbox" Style="cursor: default" runat="server" Width="100%"
                    ReadOnly="True" ToolTip="" Font-Size="Smaller" BorderColor="Lavender" BorderStyle="None"
                    Height="15px">Please select...</asp:TextBox>
                <input id="HdnField" type="hidden" runat="server" value="Please select ..." />
            </td>
            <td id="colDDImage" style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px;
                padding-top: 0px; background-color: inactivecaptiontext; height: 15px; background-repeat: no-repeat;"
                background="Controls\Images\DDImageDown.bmp" width="18" runat="server">
            </td>
        </tr>
    </table>
    <div class="DropDownClosed" id="MSDDLB_div" runat="server" align="left">
        <asp:CheckBoxList ID="MSDDLB_cblst" OnSelectedIndexChanged="MSDDLB_cblst_SelectedIndexChanged"
            runat="server" Height="15px" Width="100%" Font-Names="Trebuchet MS" BackColor="#E0E0E0">
        </asp:CheckBoxList>
    </div>
    <iframe class="iFrameClosed" id="MSDDLB_iframe" frameborder="0" scrolling="auto"
        runat="server"></iframe>
</asp:Panel>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Written By
Software Developer iNautix Technologies India Pvt Ltd
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions