Click here to Skip to main content
15,891,943 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Reports Pin
Christian Graus8-Aug-05 19:03
protectorChristian Graus8-Aug-05 19:03 
GeneralRe: Reports Pin
Anonymous8-Aug-05 20:30
Anonymous8-Aug-05 20:30 
GeneralRe: Reports Pin
Christian Graus8-Aug-05 20:40
protectorChristian Graus8-Aug-05 20:40 
GeneralRe: Reports Pin
Anonymous8-Aug-05 20:49
Anonymous8-Aug-05 20:49 
GeneralRe: Reports Pin
Christian Graus9-Aug-05 12:57
protectorChristian Graus9-Aug-05 12:57 
GeneralRe: Reports Pin
Anonymous9-Aug-05 19:14
Anonymous9-Aug-05 19:14 
GeneralGetting DNS path Pin
dlarkin775-Aug-05 21:11
dlarkin775-Aug-05 21:11 
GeneralDropDownList selection oddity Pin
Baatezu5-Aug-05 19:42
Baatezu5-Aug-05 19:42 
I'm making an ASP webpage using VB.NET. I'm creating controls on the fly. When I create my dropdownlists on the fly I am getting an odd behavior. When I change the selected value of one of the controls in the array it changes it for all of them.
I'm currently filling an array of listitems from a database and then using AddRange to add the values to each dropdownlist.
When I attempt to use the SelectedValue property of the dropdownlist to set which value is selected, it effects all of the dropdown lists. I can tell this because every drop down list is set the value the last item should have.

This is the loop I use to fill the listitem array (it's redim-ed to the proper size)
ctr = 0
For Each drddlFill In ds.Tables("dtEmps").Rows
lsiUpline(ctr) = New System.Web.UI.WebControls.ListItem
lsiUpline(ctr).Text = drddlFill("employee_id") & " - " & drddlFill("first_name") & " " & drddlFill("last_name")
lsiUpline(ctr).Value = drddlFill("employee_id")
ctr += 1
Next

Next I fill each drop down list
Row = new TableRow
Cell = new TablecCell
ddlUpline_Array(ctr).Items.AddRange(lsiUpline)
ddlUpline_Array(ctr).SelectedValue = databaseInfo("ID")
Cell.Controls.Add(ddlUpline_Array(ctr))
Row.Cells.Add(Cell)
tblBaseshop.Rows.Add(Row)

databaseInfo is pulling correct information. The rest of the row is filled with information from this so I know it is different for each row.

Every dropdownlist in ddlUpline_Array gets set to the selection of the last it.

Any advice on how to get each ddl set to a different selection? If I do a loop and fill each box from the database each time, the selection will be different for each box, but that is much too time consuming.
Thanks

The wisest of the wise may err. - Aeschylus
GeneralPlanning on making a database driven app as my first in .NET Pin
JoeySmith5-Aug-05 12:06
JoeySmith5-Aug-05 12:06 
GeneralException Pin
Brad Fackrell5-Aug-05 11:41
Brad Fackrell5-Aug-05 11:41 
GeneralRe: Exception Pin
Dave Kreskowiak5-Aug-05 12:12
mveDave Kreskowiak5-Aug-05 12:12 
GeneralRe: Exception Pin
Brad Fackrell5-Aug-05 12:26
Brad Fackrell5-Aug-05 12:26 
GeneralRe: Dynamic Reports Pin
Anonymous5-Aug-05 2:58
Anonymous5-Aug-05 2:58 
GeneralParsing HTML (again) Pin
jamie_m_4-Aug-05 23:48
jamie_m_4-Aug-05 23:48 
GeneralRe: Parsing HTML (again) Pin
J4amieC5-Aug-05 1:26
J4amieC5-Aug-05 1:26 
GeneralRe: Parsing HTML (again) Pin
jamie_m_5-Aug-05 4:23
jamie_m_5-Aug-05 4:23 
General.dll not registred Pin
Member 135222534-Aug-05 22:36
Member 135222534-Aug-05 22:36 
GeneralRe: .dll not registred Pin
Dave Kreskowiak5-Aug-05 4:42
mveDave Kreskowiak5-Aug-05 4:42 
GeneralRe: .dll not registred Pin
Member 135222535-Aug-05 5:21
Member 135222535-Aug-05 5:21 
GeneralRe: .dll not registred Pin
Dave Kreskowiak5-Aug-05 6:32
mveDave Kreskowiak5-Aug-05 6:32 
GeneralRe: .dll not registred Pin
rwestgraham5-Aug-05 7:50
rwestgraham5-Aug-05 7:50 
GeneralRe: .dll not registred Pin
Member 135222537-Aug-05 19:59
Member 135222537-Aug-05 19:59 
Generalrecently migrated from VB6...debating on C# or VB.NET Pin
JoeySmith4-Aug-05 21:22
JoeySmith4-Aug-05 21:22 
GeneralRe: recently migrated from VB6...debating on C# or VB.NET Pin
Dave Kreskowiak5-Aug-05 4:38
mveDave Kreskowiak5-Aug-05 4:38 
GeneralRe: recently migrated from VB6...debating on C# or VB.NET Pin
Dave Doknjas5-Aug-05 14:54
Dave Doknjas5-Aug-05 14:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.