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 / April 2005

Tip: Looking for answers? Try searching our database.

DataGrid: Update datasource when closing form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TT (Tom Tempelaere) - 22 Apr 2005 11:24 GMT
Hi,

The situation is the following: A user is editing a cell in a DataGrid, and
hasn't pressed <return> or <enter>, so the value is being edited. The user
then closes the form. I would like to update the value to the data source if
it is valid, or prevent closing the form if the edited value is invalid.

Actually, all I need for this to accomplish are the following two functions:
(1) A function that tells me whether or not the user is actually editing a
cell's contents.
(2) A function that tries to end the edit operation, and returns whether
ending the operation succeeded. Ending the edit operation should fail if the
value being edited is invalid (not valid).

I haven't found these yet.
About (1): I've checked DataRowView's IsEdit member, but I tested it and it
seems to return true even if a user isn't editing a cell in that row.
About (2) DataGrid has an EditEdit method. Sadly it returns false when no
cell is being edited, so I can't make the distinction between an invalid
entry or the fact that the cell isn't being edited. So using (2) alone
doesn't work.

Thanks for any help
Signature

Tom Tempelaere.

TT (Tom Tempelaere) - 22 Apr 2005 11:40 GMT
Small typo, see below

> Hi,
>
[quoted text clipped - 14 lines]
> seems to return true even if a user isn't editing a cell in that row.
> About (2) DataGrid has an EditEdit method. Sadly it returns false when no

Of course I meant EndEdit, not EditEdit.

> cell is being edited, so I can't make the distinction between an invalid
> entry or the fact that the cell isn't being edited. So using (2) alone
> doesn't work.
>
> Thanks for any help

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.