Use This Code On 'aspx' for Adding checkbox in gridview
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
</ItemTemplate>
</asp:TemplateField>
After this write code on aspx.cs
foreach (GridViewRow row in gridview1.Rows)
{
for (int i = 0; i < gridview1.Rows.Count; i++)
{
CheckBox chk = (CheckBox)row.FindControl("chkSelect");
chk.Checked = true;
}
}
try this..............