I'm not sure what I should do for checking whether the checkbox is checked, so I use boolean to verify the state. But if there is a better technique, please let me know.
In addition, I've tried the following
Checkselector=ctype(dgItem.FindControl("Checkselector"),Checkbox)
If...