Also, keep in mind that you don't always have to do this ... it's only because you want immediate feedback from the TextBox into the ListBox that you're having this problem. (Although, at some point, before you save changes, you *will* need to make sure any proposed changes have been accounted for).
for (int nTable = 0; nTable < ds.Tables.Count; nTable++)
{
for (int nRow = 0; nRow < ds.Tables[nTable].Rows.Count; nRow++)
{
if (ds.Tables[nTable].Rows[nRow].HasVersion(DataRowVersion.Proposed))
{
ds.Tables[nTable].Rows[nRow].EndEdit();
}
}
}
~~Bonnie
>But isn't .EndEdit() a method of a Row? How do I grab an instance of the Row that was changed (without iterating through the rows and looking for it)?
>
>>Steve,
>>
>>You're doing the DataBinding right. It's just that sometimes a current row needs an .EndEdit() to properly finish the edits on the row (but not always and I don't really know when it's a problem and when it's not). Anyway, if you're expecting your ListBox to reflect a new value in a TextBox after the data has been entered into the TextBox, then you should maybe do an .EndEdit() in the .Validate() of the TextBox. If it's somewhere else (like when you click on a button or whatever), you'll need to put the .EndEdit() in the appropriate event.
>>
>>~~Bonnie
>>