deleting last row in a DataGrid

  • Thread starter Thread starter J. A. Zanetti
  • Start date Start date
J

J. A. Zanetti

Hello NG,
i have this problem: in my application, i have a master-
detail form displaying two DataGrids binded to DataViews.
While the bindings work fine when moving through the
grids' rows or making insertions, i keep encountering a
problem when trying to delete the last row in a grid
(problem occurs with both grids). Deleting any row other
than the last will complete successfully.
I have tried to handle all the underlying DataViews' and
DataTables' events, but i couldn't solve my problem.
Neither could i solve the problem by catching exceptions:
all the form routines include structured exception
handling, but the run-time error i get is about a null-
reference unhandled exception. Is it depending on the
DataGrid control trying to move to the next row (which of
course does not exist)?
I would appreciate any help, thank you in advance.
Best regards,

J.
 
Just a thought . . .

Are you using context menus to call a delete function, if so, is this being
caught on MouseDown rather than mouse up ?, had something simelar before and
changed it to mouseUp which cured it.

If this is not the error, you can zip up the project if its not too big and
post it here otherwise, email it to me and I will try and help

--
Regards - One Handed Man

Author : Fish .NET & Keep .NET
=========================================
This posting is provided "AS IS" with no warranties,
and confers no rights.
 
Back
Top