N
Naim Rizk
I have some textboxes bound to a datatable.
pressing the cancel button cancels the changes
pressing the save button saves the changes
that works fine but
i noticed that if i edit a textbox and i pressed the cancel or save
button while the focus is still on the textbox the text that is in the
current textbox isn't reflected in the datarow, and this it won't be
saved or canceled. however if i moved the focus from the edited textbox
(i clicked another one for ex) then pressed the save or cancel button
the appropriate changes are made.
i used: datatable.acceptchanges/ rejectchanges
so to go around this problem i used
datarow.begineEdit / cancelEdit / endEdit
this solved the problem of the cancel but not the save
in the end i programmatically removed the focus from the text box and it
worked, although that doesn't seem the ideal solution to use.
so i was wondering if there's a known solution for this problem.
regards
pressing the cancel button cancels the changes
pressing the save button saves the changes
that works fine but
i noticed that if i edit a textbox and i pressed the cancel or save
button while the focus is still on the textbox the text that is in the
current textbox isn't reflected in the datarow, and this it won't be
saved or canceled. however if i moved the focus from the edited textbox
(i clicked another one for ex) then pressed the save or cancel button
the appropriate changes are made.
i used: datatable.acceptchanges/ rejectchanges
so to go around this problem i used
datarow.begineEdit / cancelEdit / endEdit
this solved the problem of the cancel but not the save
in the end i programmatically removed the focus from the text box and it
worked, although that doesn't seem the ideal solution to use.
so i was wondering if there's a known solution for this problem.
regards