Hi All,
New at this place. I have take a look on the thread with the same name, but my case is different, so I ask for some help if possible.
Situation: Data entry form with couple of textboxes (data bound) and some buttons like UPDATE, CANCEL ALL...
Logic: When form opens the UPDATE and CANCEL buttons should be unEnabled. Starting any editings the mentioned buttons change their state to Enabled. Any editing which rezults in returning the textboxes content to their initial context should rezult the mentioned buttons to became unEnabled. Also pressing button CANCEL ALL should rezult the mentioned butons become unEnabled (the easy task, no questions here).
My Attempts: I can code some elementary logic (which has no in common with ADO.NET) to check the changes and check the return to initial context individually for any textbox. But I want to use ADO.NET objects and their methods thinking, that the solution will be more elegant.
I try hasChanged method which I check in event handker textChanged.
if hasChanged then
btnUpdate.Enabled=true
btnCancelAll.Enabled=true
else
btnUpdate.Enabled=false
btnCancelAll.Enabled=false
end if
For some unknown reasons the both buttons get their Enable state after SECOND typing (I should press keys 2 times) and what is more important when I return the content of the textboxes using standard edit keys(del and bs) to their initial content the buttons still remail Enable.
Question:Can the hasChanged method (and particulary any ADO.NET method) be used in this situation or it is better and more elegant coding with the "standard" logic without using the ADO.NET at all.
Thank You all for Your suggestions
DAG
New at this place. I have take a look on the thread with the same name, but my case is different, so I ask for some help if possible.
Situation: Data entry form with couple of textboxes (data bound) and some buttons like UPDATE, CANCEL ALL...
Logic: When form opens the UPDATE and CANCEL buttons should be unEnabled. Starting any editings the mentioned buttons change their state to Enabled. Any editing which rezults in returning the textboxes content to their initial context should rezult the mentioned buttons to became unEnabled. Also pressing button CANCEL ALL should rezult the mentioned butons become unEnabled (the easy task, no questions here).
My Attempts: I can code some elementary logic (which has no in common with ADO.NET) to check the changes and check the return to initial context individually for any textbox. But I want to use ADO.NET objects and their methods thinking, that the solution will be more elegant.
I try hasChanged method which I check in event handker textChanged.
if hasChanged then
btnUpdate.Enabled=true
btnCancelAll.Enabled=true
else
btnUpdate.Enabled=false
btnCancelAll.Enabled=false
end if
For some unknown reasons the both buttons get their Enable state after SECOND typing (I should press keys 2 times) and what is more important when I return the content of the textboxes using standard edit keys(del and bs) to their initial content the buttons still remail Enable.
Question:Can the hasChanged method (and particulary any ADO.NET method) be used in this situation or it is better and more elegant coding with the "standard" logic without using the ADO.NET at all.
Thank You all for Your suggestions
DAG