N
nate axtell
After binding a DataGrid and a few TextBoxes to the same DataTable in VB
..NET I successfully see the TextBoxes update when I change the selection in
the DataGrid. I put DataGrid1.Invalidate() in the TextBox1.Leave event to
show modifications made in the TextBox in the DataGrid. And that works too.
My problem is when I programmatically call TextBox1.Text = "abc" then call
DataGrid1.Invalidate() the DataGrid row is not updated with the correct
value from the TextBox. It is not updated at all. If I then click on a
different row to change the selection, THEN the row is updated with the
correct value that was set in the TextBox programmatically.
Does anyone have a clue why the DataGrid doesn't get the correct value from
the DataTable until after I change the selected row? Even hiding the window
and expanding it again to manually force a redraw to occur doesn't work. So
I don't think it is that Invalidate on the grid is the problem.
A work around I came up with is the following:
TextBox1.Text = "abc"
..NET I successfully see the TextBoxes update when I change the selection in
the DataGrid. I put DataGrid1.Invalidate() in the TextBox1.Leave event to
show modifications made in the TextBox in the DataGrid. And that works too.
My problem is when I programmatically call TextBox1.Text = "abc" then call
DataGrid1.Invalidate() the DataGrid row is not updated with the correct
value from the TextBox. It is not updated at all. If I then click on a
different row to change the selection, THEN the row is updated with the
correct value that was set in the TextBox programmatically.
Does anyone have a clue why the DataGrid doesn't get the correct value from
the DataTable until after I change the selected row? Even hiding the window
and expanding it again to manually force a redraw to occur doesn't work. So
I don't think it is that Invalidate on the grid is the problem.
A work around I came up with is the following:
TextBox1.Text = "abc"