Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a reliable way to set Save/Cancel button status
Message
From
07/05/2003 14:39:21
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00785839
Message ID:
00785937
Views:
14
Don,

You replied with nothing ... did you accidentally hit send too soon?



>>Don,
>>
>>Your original idea (checking the ds.HasChanges()) will work ... the reason that you found that changes to bound textboxes don't always show up as being changed is because you need to do an EndEdit() on the row (syntax is something like ds.Tables[0].Rows[0].EndEdit()). Then ds.HasChanges() will correctly return True.
>>
>>~~Bonnie
>>
>>>I want to find a reliable method for enabling/disabling the buttons based on changes made to a VB.Net form. This was simple in VFP using InteractiveChange() event to set a "changed" status to .T. and enable the buttons.
>>>
>>>In .Net I'm getting into way too much complexity so I wanted to see if there is a "Best Practice" or simple method for this that I have missed.
>>>
>>>Originally I tried checking the Dataset.HasChanges property but I found I could make changes to a bound textbox and HasChanges return False. So then I started using events such as textbox.Keypress, checkbox.CheckStateChanged, etc. to track changes but there are lots of factors I am having to work around in doing this (Such as "Delete" key is not tracked in Keypess() and many other such oddities). My workaround code is growing larger and more complex, so I figure it's time to check in here and get some advice!
>>>
>>>So - has anyone worked out a simple and reliable method for Enabling/Disabling and options? Is there a recommended technique for this I am missing?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform