Data Grid: Adding new Rows

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
 
M

Marvin Varela

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top