Link to home
Start Free TrialLog in
Avatar of Isaac Johnson
Isaac JohnsonFlag for United States of America

asked on

Bootstrap Multi Select Issues, databind

Am I having a problem with bootstrap multiselect.  I am losing the checkboxes on display by way of
on click which opens the multiselect items. Ctrl and click will select the items but the checkboxes have
disappeared alone with the make selection button which appears before the items to select from in the list.  I would also
like to combine text fields in my source prior to databind.  See Attached. My code is below

When asp button is clicked,  the link box associated button is made visible
<div>

<asp:ListBox ID="ListBox1" runat="server" Height="240px" SelectionMode="Multiple" Width="400px" BackColor="#CCFFFF" Visible="false" Rows="400" AutoPostBack="False"></asp:ListBox>

<asp:Button ID="Button1" runat="server" Text="Submit" Visible="false" Enabled="false" CausesValidation="false"/>

<asp:Label ID="label1" runat="server" Text="<< See Selections" Visible="false" Enabled="true"/>

</div>

<script type="text/javascript">

$(function () {

$('#ListBox1').multiselect({

includeselectAllOptions: true

})

})

</script>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous" />

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css" type="text/css" />

<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.min.js" ></script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>

<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" ></script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/js/bootstrap-multiselect.js"></script>
==================================
 Dim strCommand As New SqlCommand
        strCommand.Connection = con
        strCommand.CommandType = CommandType.StoredProcedure
        strCommand.CommandText = "[dbo].[av_get_active_conference_rooms]"

        Dim da As New SqlDataAdapter

        da.SelectCommand = strCommand


        Dim dt As New DataTable

        'da.Fill(dt)



        ListBox1.DataSource = dt
        ListBox1.DataTextField = "conference_room_name"
        'ListBox1.DataTextField = "Name"
        ListBox1.DataValueField = "audio_visual_conference_room_id"
        'ListBox1.DataTextField = "building"

        Dim dc As DataColumn
        dc = New DataColumn("Name")
        dc.DataType = System.Type.GetType("System.String")
        dc.Expression = "conference_room_name + building + audio_visual_conference_room_id"

        da.Fill(dt)
        ListBox1.DataBind()
        con.Close()
expertImage2.jpg
ASKER CERTIFIED SOLUTION
Avatar of Swatantra Bhargava
Swatantra Bhargava
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Isaac Johnson

ASKER

Produced the same results no checkboxes.  Is this the modified code.  It looks the same as the code I sent out?
Worked!
Thanks for your help.