I have addded columns and checkboxes Dynamically... But met with a problem that the CheckedChanged Event is not fired.. here is my Code..
protected void ddlRole_SelectedIndexChanged(object sender, EventArgs e)
{
for (int i = 0; i < DtOperation.Rows.Count; i++)
{
Dt.Columns.Add(DtOperation.Rows[i][0].ToString());
}
dgrDynamic.DataSource = Dt;
dgrDynamic.DataBind();
.
.
tcCheckCell = new TableCell();
var checkBox = new CheckBox();
checkBox.ID = DtOperation.Rows[i][0] + "|" + DtOperation.Rows[i][2];
checkBox.AutoPostBack = true;
checkBox.Checked = true;
checkBox.CheckedChanged +=new EventHandler(checkBox_CheckedChanged);
tcCheckCell.Controls.Add(checkBox);
dgrDynamic.Rows[j].Cells.RemoveAt(GetColumnIndexByName((int)DtOperation.Rows[i][2]));
dgrDynamic.Rows[j].Cells.AddAt(GetColumnIndexByName((int)DtOperation.Rows[i][2]), tcCheckCell);
}
void checkBox_CheckedChanged(object sender, EventArgs e)
{
...Code;
}
am a fresher in this field and can you pls help me to Over come the misery.. Thank you all