Thank you for your reply. But this is not hte case
I am sure that the BindingManagerBase is the same for the Grid and the TextBox
I executed this code
if
(this.BindingContext[grdInformation.DataSource].Equals(txtName.DataBindings["Text"].BindingManagerBase))
{
MessageBox.Show("equal");
}
and I always see the MessageBox.
The point is, the view is in sync (when I clcik a row in the DataGrid I see
the correct data in the TextBox) but when I edit the name in the TextBox and
leave the TextBox the data is not reflected in the DataGrid. I have to call
EndEdit() on the current DataRowView. Any suggestions
Hi,
I would suggest to give it a try.In msdn website also they have suggested
this only.Write your code in following format:
this.dataGridView1.DataSource = dataSet;
this.dataGridView1.DataMember = "Numbers";
this.textBox1.DataBindings.Add("Text", dataSet, "Numbers.Name", true);
instead of in this format:
this.dataGridView2.DataSource = dataTable;
this.textBox2.DataBindings.Add("Text", dataTable, "Name", true);

Signature
Hope this answers your question.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.
> Thank you for your reply. But this is not hte case
> I am sure that the BindingManagerBase is the same for the Grid and the TextBox
[quoted text clipped - 10 lines]
> leave the TextBox the data is not reflected in the DataGrid. I have to call
> EndEdit() on the current DataRowView. Any suggestions
Shehab Kamal - 26 Jun 2007 07:38 GMT
It is a matter of refresh!
I have the following
dataView1.Table = dataTable1; // A DataTable that has 2 column "ID", "Name"
dataGrid1.DataSource = dataView1;
txtID.DataBindings.Add(new Binding("Text", dataView1, "ID"));
txtName.DataBindings.Add(new Binding("Text", dataView1, "Name"));
The TextBoxes and the DataGrid are in sync because they share the same
CurrencyManager. However when I change a value in the TextBox it is not
reflected in the DataGrid unless I choose another row.
To solve it I have added the following code the Leave and Enter events of
the TextBoxes
// 1) Change the Posintion of the CurrencyManager
this.BindingContext[dataGrid1.DataSource].Position++;
// OR 2) Invoke EndEdit
dataView1[this.BindingContext[dataGrid1.DataSource].Position].EndEdit();
// OR 3) Refresh the DataGrid
dataGrid1.Refresh();
I suggets the second method.
Thank you for your help and the great document.