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?

Re: How to initialize hidden columns for newly added rows ? by Claes

Claes
Thu Jun 16 03:21:16 CDT 2005

Try handling the DataTable.RowChanging or DataTable.RowChanged
events. They should be raised with the Action parameter set to Add

/claes

"Lee Gillie" <Lee@nospam.odp.com> wrote in message
news:eqUQSrbcFHA.3712@TK2MSFTNGP12.phx.gbl...
>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?



Re: How to initialize hidden columns for newly added rows ? by Lee

Lee
Thu Jun 16 11:28:16 CDT 2005

Claes -

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

Best regards - Lee Gillie