Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2006

Tip: Looking for answers? Try searching our database.

Cancelling a new row in an unbound datagridview

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kelllisa@gmail.com - 31 Jul 2006 01:36 GMT
When a user adds a row to an unbound datagridview, then clicks out of
the row (or the control loses focus for any reason) without entering
anything, I would like to have the row automatically deleted.  However,
I cannot find an appropriate event to handle this case.  Using
CellEndEdit results in a re-entry, and CellValidating/Validated and
most other events result in an InvalidOperationException.

Does anyone know where I could put this logic?

Thanks.
simida - 31 Jul 2006 03:03 GMT
Maybe grid's Leave event will help you.

In this event handler function, you can get all grid items and check
the last item whether it is empty.

Hope it works.

Sincerely,
simida

Kelllisa@gmail.com 写道:

> When a user adds a row to an unbound datagridview, then clicks out of
> the row (or the control loses focus for any reason) without entering
[quoted text clipped - 6 lines]
>
> Thanks.
K - 31 Jul 2006 23:38 GMT
That might help; although I will need to handle the case where the user
clicks or arrows to another row in the grid, and not out of the control
entirely.  I will give it a shot.

Thanks for your help

> Maybe grid's Leave event will help you.
>
[quoted text clipped - 18 lines]
> >
> > Thanks.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.