Data Grid: Adding new Rows

  • Thread starter Thread starter Asela Gunawardena
  • Start date Start date
A

Asela Gunawardena

Hi
There is a databound grid that is being used in one of my Master - Detail
form there I need to keep two columns hidden and assign Autogenerated values
once a user adds a new record through the grid. can somebody please tell me
how to do this; as i couldn't find a single event that is fired once a new
row is added to the grid; and also i have tried quite a bit of fruite less
methods like medling with the data source etc. can somebody please help me
on this.

thankx in advance
 
You have to use the events associated with the datasource of the grid and
not with the grid itself.

If your datasource is a DataTable you culd use DataTable.RowChanged event.
the parameter DataRowChangeEventArgs e will give you an Action property
where you can find if the row was added and an instance of the inserted
DataRow.

Hope this helps.
 
Back
Top