DataList checkbox status

  • Thread starter Thread starter Vannela
  • Start date Start date
V

Vannela

I want to get the status of the checkbox control in the
item template of the DataList in the code behind

Using findcontrol i am not able to get the status of the
checkbox . How shouls i get the status of the checkbox
whether it is checked or not?\

Thank you
 
Hi Vannela,
This piece of code should do (the key is to iterate the Items collection!).

foreach ( DataListItem item in ItemsList.Items )
{
CheckBox chk = (CheckBox) item.FindControl("CheckBox1");
bool checkedValue = chk.Checked;
}

Regards
Claudio
 
Back
Top