Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CancelEdit() and DataBindings against textBoxes

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I have a simple form with a DataGrid and three data-bound textBoxes.
I can call BeginEdit(), EndEdit() and CancelEdit() against the DataRow being worked on.
However, if I change values in the textBoxes and then click 'CancelEdit' the values (as changed in the textBox) is still held in the DataRow / dataGrid / textBoxes until I move focus elsewhere.
If I move to a different DataRow in the grid and then back again - the data is as before the BeginEdit was called.
How can I refresh the data (dataGrid + textBoxes data-bound) following the CancelEdit() call ?

Thanks in advance
Steve
 
if this 'canceledit' is a button that you control the event of, then you could add something along the lines of 'myThingThatNeedsRefreshing.Refresh()' to method you have tied to that event.

if not, is there an event relevent to 'canceledit()' that you could call refresh from? there doesn't seem to be a canceledit per se, but perhaps something along the lines of 'currentcellchanged' would work.

____________________________________________________
If you like a post, show you care by giving it a star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top