N
nicomp
Hello,
I have a FormView control that has a CheckBoxList in the Item
template...
I wrote this code to access a CheckBoxList in a FormView template...
dim foo as checkboxlist
foo = Me.fvVehicle.FindControl("cblSafety")
foo.items(0).selected = true
This code does not set the check box in the cbl. No errors, but nothing
happens.
If the checkBoxList is moved out of the the FormView control, then this
works fine:
cblSafety.Items(0).selected = true
But I can't refernence the cbl control by name if it's in the FormView.
Therefore this approach will not work at all.
I also tried it by ID and it didn't work either...
dim foo as Integer
foo = me.fvVehicle.FindControl("cblSafety").ID
dim bar as CheckBoxList
bar = me.FindControl(foo)
bar.Items(0).Selected = True
Any thoughts?
Bill
Cincinnati, OH USA
I have a FormView control that has a CheckBoxList in the Item
template...
I wrote this code to access a CheckBoxList in a FormView template...
dim foo as checkboxlist
foo = Me.fvVehicle.FindControl("cblSafety")
foo.items(0).selected = true
This code does not set the check box in the cbl. No errors, but nothing
happens.
If the checkBoxList is moved out of the the FormView control, then this
works fine:
cblSafety.Items(0).selected = true
But I can't refernence the cbl control by name if it's in the FormView.
Therefore this approach will not work at all.
I also tried it by ID and it didn't work either...
dim foo as Integer
foo = me.fvVehicle.FindControl("cblSafety").ID
dim bar as CheckBoxList
bar = me.FindControl(foo)
bar.Items(0).Selected = True
Any thoughts?
Bill
Cincinnati, OH USA