M
MSN
xp pro/vs 2002/web forms/VB
How do I make a checkbox checked when add it to a checkboxlist.
Thanks
How do I make a checkbox checked when add it to a checkboxlist.
Thanks
* "MSN said:How do I make a checkbox checked when add it to a checkboxlist.
* "Cor Ligthert said:Look at the post from Herfried, therefore I made some extra work to correct
it.
I still don't understand why Jay's solution should be wrong...
* "Cor Ligthert said:Did I say that Herfried?
Not with that quoting, looks if I reals sayd that now.Sounded like that, but EOT ;-).
Jay B. Harlow said:MSN,
The following works in VS.NET 2003.
Dim item As ListItem
item = New ListItem
item.Selected = True
item.Text = "Product1"
item.Value = "1"
CheckBoxList1.Items.Add(item)
item = New ListItem
item.Selected = False
item.Text = "Product2"
item.Value = "2"
CheckBoxList1.Items.Add(item)
item = New ListItem
item.Selected = True
item.Text = "Product3"
item.Value = "3"
CheckBoxList1.Items.Add(item)
The first & third item will be checked, the second will not.
Hope this helps
Jay
want
What post from Herfried? The only post from Herfried (as well as you) in
this thread is about using the Windows Forms CheckBoxList?