troubleshooting Question

ASP.NET - VB - Need to make exact copies of a dropdown list

5 Comments1 Solution879 ViewsLast Modified:
Hello Experts,

I have a form with 14 dropdown lists on it.  I'm populating the first of the 14 though a database query.  This is working fine.  The other 13 dropdown lists need to be identical to the first one.  Instead of hitting the database for each one, I'd rather just make the others carbon copies of the first one.  But I'm not sure how to do that.  The dropdown lists are named named ddlODRTC1 - ddlODRTC14.

I'm thinking of something like this:

        'Create a loop to copy data from ddlORTC1 to the other DDLs
        For xCounter As Integer = 2 To 14
            Dim ddlODRTC As DropDownList = Me.FindControl("ddlODRTC" & xCounter)
            If Not ddlODRTC Is Nothing Then

                'copy values of ddlODRTC1 to ddlODRTC

            End If
        Next xCounter

I'm fairly certain this'll work, I'm just not sure how to actually copy the data from one dropdown list to another.  Can anyone help me with this?

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
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