P
Patrick.O.Ige
I have a Checkboxlist that is databinded and i want to pass it a boolean
value from a table because i want
to display the checked values if its TRUE.
When Databinding my checkboxlist i'm not passing the column name with the
boolean values to the DataValueField
which is the column "checked" but instead i want to loop through the
checkboxlist and pass the Boolean values to it like so below
But it seems not to work.!!!
Any ideas??
Some one suggested to use a Repeater with a checkbox but hoping to get more
Help?
chkDebtor.DataSource = objDR
chkDebtor.DataValueField = "DebtorCodeID"
chkDebtor.DataTextField = "DebtorCode"
chkDebtor.DataBind()
Dim currentCheckBox As ListItem
For Each currentCheckBox In chkDebtor.Items
While objReader.Read
If Not (currentCheckBox Is Nothing) Then
'If currentCheckBox Is Nothing Then
'I tried passing the Boolean checkBox selected to a boolean here
currentCheckBox.Selected = CBool(objReader("checked"))
'Prints out the boolean value to check
Response.Write("<b>" & CBool(objReader("checked")) & "</b>")
End If
End While
Next
value from a table because i want
to display the checked values if its TRUE.
When Databinding my checkboxlist i'm not passing the column name with the
boolean values to the DataValueField
which is the column "checked" but instead i want to loop through the
checkboxlist and pass the Boolean values to it like so below
But it seems not to work.!!!
Any ideas??
Some one suggested to use a Repeater with a checkbox but hoping to get more
Help?
chkDebtor.DataSource = objDR
chkDebtor.DataValueField = "DebtorCodeID"
chkDebtor.DataTextField = "DebtorCode"
chkDebtor.DataBind()
Dim currentCheckBox As ListItem
For Each currentCheckBox In chkDebtor.Items
While objReader.Read
If Not (currentCheckBox Is Nothing) Then
'If currentCheckBox Is Nothing Then
'I tried passing the Boolean checkBox selected to a boolean here
currentCheckBox.Selected = CBool(objReader("checked"))
'Prints out the boolean value to check
Response.Write("<b>" & CBool(objReader("checked")) & "</b>")
End If
End While
Next