take one hiddenfield and put besides checkbox and assign rowindex to it.
<asp:checkbox id="yourcheckbox/" xmlns:asp="#unknown"><asp:hiddenfield runat="server" id="hidRowIndex" value="<%# Container.DataItemIndex %>" /></asp:checkbox>
and retrieve using
protected void btnLink_Click(object sender, EventArgs e) { foreach (GridViewRow row in gvAllocated.Rows) { if (((CheckBox)row.FindControl("chkLink")).Checked) {
int index = (((HiddenField)row.FindControl("hidRowIndex")).Value;
} } }