troubleshooting Question

List box help

Avatar of DowntownIT
DowntownITFlag for United States of America asked on
5 Comments1 Solution242 ViewsLast Modified:
I have an accordion where I am creating each pane dynamically through code. I am then dynamically creating and adding a list box and list items to each of the panes. What I can’t figure out, is how to capture the selected value and text of any given list box. I also need to be able that if the user selects a item from the list box in any of the panes that all other selected list box items of the other panes are cleared.

Thanks for the help!
Public Sub BuildAccordion()

        Dim dt As DataTable = ListData1.DefaultView.ToTable("MyPanes", True, New [String]() {"Screen_no", "Screen_desc"})

        For Each row As DataRow In dt.Rows

            Dim myStrExpr As String
            myStrExpr = "screen_no = " & row("Screen_no").ToString
            Dim lbScreen As New ListBox

            For Each row1 As DataRow In ListData1.Select(myStrExpr)
                lbScreen.Items.Add(New ListItem(row1("Floor/Location/Position").ToString, "Seat_no"))

            CreateAccPane(row("Screen_desc").ToString, row("Screen_desc").ToString, lbScreen)
    End Sub

    Public Sub CreateAccPane(ByVal PaneID As String, ByVal PaneHeader As String, ByVal PaneContent As ListBox)
        Dim panel1 As AccordionPane = New AccordionPane
        panel1.ID = PaneID
        panel1.HeaderContainer.Controls.Add(New LiteralControl(PaneHeader))



    End Sub

Open in new window


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros