How to initialize hidden columns for newly added rows ?

  • Thread starter Thread starter Lee Gillie
  • Start date Start date
L

Lee Gillie

I want to allow the user to add new rows. Not all columns from the bound
data tabled are mapped (i.e. there are hidden columns). But some of
those columns do not allow null. When I add a new row I get an exception:

A first chance exception of type 'System.Data.NoNullAllowedException'
occurred in system.data.dll
Additional information: Column 'REP_ID' does not allow nulls.

Question is, How can I provide a proper row initialization when the grid
creates a new row? That is, how can I detect the newly added row, and
perform some initialization on the row's column values?
 
Try handling the DataTable.RowChanging or DataTable.RowChanged
events. They should be raised with the Action parameter set to Add

/claes
 
Claes -

That's the ticket! Thank you for taking a moment to help.

Best regards - Lee Gillie
 
Back
Top