PC Review


Reply
Thread Tools Rate Thread

DataGrid: Update data source when closing form

 
 
=?Utf-8?B?VFQgKFRvbSBUZW1wZWxhZXJlKQ==?=
Guest
Posts: n/a
 
      22nd Apr 2005
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 EndEdit 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
--
Tom Tempelaere.

 
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
Want form to show changing data. But it could be closed, or closing, during update. Zytan Microsoft C# .NET 22 2nd Jun 2007 07:41 PM
Want form to show changing data. But it could be closed, or closing, during update. Zytan Microsoft C# .NET 0 22nd May 2007 09:10 PM
DataGrid: Update data source when editing a cell and closing the f =?Utf-8?B?VFQgKFRvbSBUZW1wZWxhZXJlKQ==?= Microsoft C# .NET 4 23rd Apr 2005 09:43 AM
DataGrid: Update datasource when closing form =?Utf-8?B?VFQgKFRvbSBUZW1wZWxhZXJlKQ==?= Microsoft Dot NET Framework Forms 1 22nd Apr 2005 11:40 AM
Data Binding - DataGrid to update a form? ChInKPoInt [No MCSD] Microsoft ASP .NET 2 8th Dec 2004 02:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:41 AM.