Step: 1
protected void gvSkills_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string ctrlname = "";
string[] A = new string[gvSkills.Columns.Count - 4];
string chklist = "";
for (int K = 4;K < gvSkills.Columns.Count; K++)
{
CheckBox Chk;
ctrlname = "chk" + myTable.Columns[K].ColumnName.ToString();
Chk = (CheckBox)e.Row.FindControl(ctrlname);
A[K - 4] = Chk.ClientID;
if (K == 4)
{
chklist = Chk.ClientID.ToString();
}
else
{
chklist = chklist + "^^###^^" + Chk.ClientID.ToString();
}
}
for (int j = 4; j < gvSkills.Columns.Count; j++)
{
CheckBox Chk;
ctrlname = "chk" + myTable.Columns[j].ColumnName.ToString();
Chk = (CheckBox)e.Row.FindControl(ctrlname);
Chk.Attributes.Add("onclick", "return SelectOne('" + Chk.ClientID + "','" + chklist + "');");
}
}
}
Step: 2