Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Flushing' data-bound controls
Message
From
31/10/2003 16:42:33
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
'Flushing' data-bound controls
Miscellaneous
Thread ID:
00845238
Message ID:
00845238
Views:
54
If I edit a data-bound control on a form, then click on the form's "close" button without allowing the control to lose focus, the new value of the control is not reflected in the bound DataSet. I have a handler for the Closing event that is checking for changes to the data set, but if the user doesn't shift focus off the current control (in my case, a DataGrid) before clicking the close button, the changed values do not get written to the DataSet.

Any ideas on how this problem can be addressed?

We had this same problem in Visual FoxPro. The solution was to find out which control has focus, and simply re-set focus to that control. This would cause the LostFocus() and Valid() EventMethods to fire, and flush the new value of the control to the bound cursor.

Not knowing what else to try, I tried this in my .NET form, both resetting focus to the control that has focus, and also shifting focus programmatically to a prior control, but neither had any effect.

Someone must have solved this sometime or other! <s>

Thanks.
>>-Steve->>

Steve Sawyer
Geeks and Gurus, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform