views:

85

answers:

1

Using windows.forms, I have a tabcontrol with a listbox and several textboxes all bound to a datatableadapter. When the user selects a member in the listbox the corresponding textboxes are populated. The problem is that, when the user edits the text in a textbox it is not being written back to the datatable. So when they select a different member in the listbox their changes are lost. I'm trying to handle the textchanged event but cannot find how to update the datatable with the changes.

A: 

I think you should handle the Leave event of the Textbox which is fired when the focus of the textbox is lost. Then you need to write the the change back to the database.

David
I don't want to write to the database. I need to update the datatable but I can't figure out how to get to it.
oops sorry. You use DataTable.Rows[rowIndex][columnIndex] = value
David
that is the crux of the matter. I can see the binding source but not how to walk it to get to the datatable that is behind the texbox