This is just an example for your scenario:-
protected void Page_Load(object sender, EventArgs e)
{
ArrayList arr = new ArrayList();
arr.Add("1");
arr.Add("2");
arr.Add("3");
arr.Add("4");
arr.Add("5");
arr.Add("6");
arr.Add("7");
GridView1.DataSource = arr;
GridView1.DataBind();
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox chk = (CheckBox)e.Row.FindControl("CheckBox1");
if (e.Row.RowIndex <= 4)
{
chk.Checked=true;
}
}
}