I have a block of code where i am checking checkboxes, comparing the contents of the datatable in the given code:
foreach (DataRow dr in dtResult.Rows)
{
for (var i = 0; i < chkboxListWorkTypes.Items.Count; i++)
{
if (chkboxListWorkTypes.Items[i].Value.Equals(dr["WorkTypeID"].ToString()))
{
chkboxListWorkTypes.Items[i].Selected = true;
}
}
}
Any labmda or linq expression would be great.
This is what I do
if the ID on the checkboxes is diferent (that probably is),