Punkcrib
10-10-2007, 03:57 PM
Hello. I have 3 drop down lists that pull info from a DB. When the 1st is changed, the 2nd is populated, and when the 2nd is changed the 3rd is populated.
What I want to do is set all 3 DDL's to be the same width (the width of the longest one, whichever it may be).
I've written this script to check & set the lengths, but for some reason it always sets the lengths to "0":
Private Function DDLSize()
Dim d1 As Integer
Dim d2 As Integer
Dim d3 As Integer
Dim df As Integer
d1 = Me.DropDownList1.Width.Value
d2 = Me.DropDownList2.Width.Value
d3 = Me.DropDownList3.Width.Value
df = d1
If d2 > df Then
df = d2
End If
If d3 > df Then
df = d3
End If
Me.DropDownList1.Width = df
Me.DropDownList2.Width = df
Me.DropDownList3.Width = df
End Function
Can anyone tell me why this happens? My DDL's don't show up when I load the page because their size is being set to "0". If I manually enter a number in the last 3 lines of code (Me.DropDownList1.Width = "50") it works fine.
Why is it pulling "0" as the length of "Me.DropDownList1.Width.Value"???
This method is called after the data is binded, so I don't get it.
What I want to do is set all 3 DDL's to be the same width (the width of the longest one, whichever it may be).
I've written this script to check & set the lengths, but for some reason it always sets the lengths to "0":
Private Function DDLSize()
Dim d1 As Integer
Dim d2 As Integer
Dim d3 As Integer
Dim df As Integer
d1 = Me.DropDownList1.Width.Value
d2 = Me.DropDownList2.Width.Value
d3 = Me.DropDownList3.Width.Value
df = d1
If d2 > df Then
df = d2
End If
If d3 > df Then
df = d3
End If
Me.DropDownList1.Width = df
Me.DropDownList2.Width = df
Me.DropDownList3.Width = df
End Function
Can anyone tell me why this happens? My DDL's don't show up when I load the page because their size is being set to "0". If I manually enter a number in the last 3 lines of code (Me.DropDownList1.Width = "50") it works fine.
Why is it pulling "0" as the length of "Me.DropDownList1.Width.Value"???
This method is called after the data is binded, so I don't get it.