cblConference it the check box list. This worked for me on an aspx page.
for(int i = 0; i<this.cblConference.Items.Count;i++)
{
if(cblConference.Items[i].Selected)
{
if(!checkConference(cblConference.Items[i].Value))
{
dtConference.Rows.Add(dtConference.NewRow());
iCounter = dtConference.Rows.Count-1;
dtConference.Rows[iCounter]["PersonID"]=sPersonID;
dtConference.Rows[iCounter]["Conference"]=cblConference.Items[i].Value.ToString();
dtConference.Rows[iCounter]["Notes"]=sPersonID;
}
}
"luisg" wrote:
I am having some difficulty getting a checkboxlist control to determine
which checkboxes are checked. Here is a code sample from the event that
should read it:
private void addToSelectedGroups()
{
foreach(ListItem item in cblGroups.Items)
{
if (item.Selected)
{
// do something
}
}
}
The problem is that item.Selected is always false regardless of whether
the box is checked.
thanx
Luis