//前台
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
//后台
for (int i = 0; i < this.GridView1.Rows.Count; i++)
{
bool isChecked = ((CheckBox)GridView1.Rows[i].FindControl("CB")).Checked;
if (isChecked)
{
ID = ((Label)GridView1.Rows[i].FindControl("lblID")).Text;
}
}