N
Nick
Hi,
I have a winform that displays header information related
to a task the user selected to work on. On the form there
is a datagrid that has detail rows for the task (e.g.
date, note, duration columns). The datagrid is bound to a
dataset. The datarow has a taskid column that is not
shown in the datagrid.
Updating data in the grid works fine. But, when I start a
new row in the datagrid, populate the three columns
(date, note, duration) and then try to go to another
control, which causes the row to lose focus and try to
save the new datarow, I get a 'can not insert a null
value in the taskid column' which makes total sense.
The user should not need to enter (or see) the taskid in
datagrid row as the taskid is already on the form.
I could not find an event in any of the related objects
that allows me to add the taskid to the taskid column
just before the datarow insert to avoid the error.
I finally found away around the null error by setting the
columns default value to the task id which does the
trick.
I was wondering if anyone knew other techniques to handle
the above. I would have expected and event somewhere in
the datarow, datatable, dataset, databinding manager,
etc. objects that allow the hook I need to perform the
above.
Thanks Nick
I have a winform that displays header information related
to a task the user selected to work on. On the form there
is a datagrid that has detail rows for the task (e.g.
date, note, duration columns). The datagrid is bound to a
dataset. The datarow has a taskid column that is not
shown in the datagrid.
Updating data in the grid works fine. But, when I start a
new row in the datagrid, populate the three columns
(date, note, duration) and then try to go to another
control, which causes the row to lose focus and try to
save the new datarow, I get a 'can not insert a null
value in the taskid column' which makes total sense.
The user should not need to enter (or see) the taskid in
datagrid row as the taskid is already on the form.
I could not find an event in any of the related objects
that allows me to add the taskid to the taskid column
just before the datarow insert to avoid the error.
I finally found away around the null error by setting the
columns default value to the task id which does the
trick.
I was wondering if anyone knew other techniques to handle
the above. I would have expected and event somewhere in
the datarow, datatable, dataset, databinding manager,
etc. objects that allow the hook I need to perform the
above.
Thanks Nick