Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Hondo Chalthoum    on Dec 22 In Asp.net Category.

  
Question Answered By: Scarlett Hughes   on Dec 22

I figured out what happened. I was
getting an error when I went to close the cmd object connection, but
until I was viewing in the local browser in VS.NET, as opposed to
building and browsing, I didn't see it. That was why the checks
weren't showing up in the checkboxes. One way to set  the Checkbox
list is like this:

'iterate through the check boxes in the checkbox list  - "li" has
been declared as a listitem. chkEvents is the name of the
checkboxlist


For Each li In Me.chkEvents.Items
'if the list item value equals the db value we're
comparing(tmpDRValue is a variable set to DR1.GetValue(7), the 8th
element in the Datareader)

If li.Value = tmpDRValue Then
'set the Selected to true and this checkbox will
be checked.

li.Selected = True


End If

'iterate to the next checkbox in the list
Next

End While

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on CheckBoxList - SET Selected Or get search suggestion and latest updates.


Tagged: