PC Review


Reply
Thread Tools Rate Thread

deleting last row in a DataGrid

 
 
J. A. Zanetti
Guest
Posts: n/a
 
      4th Sep 2003
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.
 
Reply With Quote
 
 
 
 
One Handed Man
Guest
Posts: n/a
 
      4th Sep 2003
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.


"J. A. Zanetti" <(E-Mail Removed)> wrote in message
news:117601c372f6$fa03f330$(E-Mail Removed)...
> 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.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting a row in a datagrid NDady via DotNetMonster.com Microsoft ASP .NET 2 5th Jun 2005 08:35 PM
Deleting row in Datagrid Lisa Microsoft ASP .NET 4 15th Aug 2004 12:31 AM
deleting datagrid row Tim Seaburn Microsoft ASP .NET 2 2nd Jul 2004 07:29 PM
Re: Deleting a row from a datagrid Cor Microsoft Dot NET 3 24th Mar 2004 08:26 PM
Deleting last row in datagrid Microsoft VB .NET 1 15th Jan 2004 08:42 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:14 AM.