The reason your are getting a null is that (as per your comment), you need to access a row in the grid view and then use find control. But you are probably doing it using the grid view (or the button). I guess so at least. You haven't posted all your code.
Check out the following tutorial -
http://www.asp.net/data-access/tutorials/adding-a-gridview-column-of-checkboxes-cs[
^]
Especially this section -
Step 4: Adding Check All and Uncheck All Buttons
private void ToggleCheckState(bool checkState)
{
foreach (GridViewRow row in Products.Rows)
{
CheckBox cb = (CheckBox)row.FindControl("ProductSelector");
if (cb != null)
cb.Checked = checkState;
}
}
This tutorial might be the key for all your questions!