I want to dynamically add a checkbox to a dynamic GridView along with an Event.
i.e. For the grid I have to add check boxes dynamically checked or unchecked accord
if you are adding checkboxes at runtime, when you add checkbox, the checkbox event needs to be defined.
For example :
TableCell tcCheckCell = new TableCell();
var checkBox = new CheckBox();
checkBox.CheckedChanged += checkBox_CheckedChanged;
tcCheckCell.Controls.Add(checkBox);
gridView.Rows[0].Cells.AddAt(0, tcCheckCell);
void checkBox_CheckedChanged(object sender, EventArgs e)
{
//do something: You can use Krishna Thota's Code.
}