As per my understand the post your requirement is, based on checkbox selection you need to perform some action like button click at that time based on DataKeyNames of gridview you need to perform some action.
Ex:
Protected void btnSave_Click(object sender, EventArgs e)
{
Button btn=sender as Button;
GridViewRow row = btn.NamingContainer as GridViewRow;
int KeyValue=Convert.ToInt32(gv.DataKeys[row.RowIndex].Value.ToString());
}