You don’t need to use the AddingDataRow event to do this. DataRowTemplate is, as his name indicates, a template. So if you use this :
private void Form1_Load(object sender, System.EventArgs e)
dataRowTemplate1.Cells[ “EmployeeID” ].ValueChanged += new EventHandler(EmployeeID_ValueChanged);
//then fill the grid with data
each cell of the EmployeeID column will be subscribed to this event handler, and it will work fine.
When in a bound grid, as soon as the DataSource property is set, the columns are all created, which means that you will be able to use this template to set up the event handler on any column available in the DataSet, and it will actually be subscribed to when filling the grid with data.
Imported from legacy forums. Posted by André (had 499 views)