G
Guest
I have a Windows form that displays a database table in a DataGrid. When you
click on a row, the row's values get copied to bound TextBoxes below, and
when the "Save" button is clicked the database is updated (as is the DataGrid
row) with changed values in the TextBoxes. Here are some observations:
1) When changes are typed into a text box and "Save" is clicked, the changes
are reflected in the DataSet.Tables().Rows().ItemArray value, but not in the
bound DataGrid. The RowState is "Unchanged" until EndEdit() is executed, when
it becomes "Modified". The changes are reflected in the DataGrid after the
Update command has completed.
2) When changes are programmatically made to the Text property of the text
box, changes are not reflected in the DataSet, either in the ItemArray value
or visually in the DataGrid. RowState remains "Unchanged".
3) When changes are programmatically made to the DataSet Item itself, they
are visible in both the DataGrid and TextBox and RowState is "Modified" after
EndEdit().
So my question is what specifically related to the bound control causes the
RowState property to be changed to Modified? The documentation that I have
found all say that it is when the dataset is modified, but I've not seen a
more explicit definition of what that means.
I want to see the same behavior when I programmatically update the bound
TextBox as when the user types in a change (as in #1 above).
Thanks in advance....
Tim
click on a row, the row's values get copied to bound TextBoxes below, and
when the "Save" button is clicked the database is updated (as is the DataGrid
row) with changed values in the TextBoxes. Here are some observations:
1) When changes are typed into a text box and "Save" is clicked, the changes
are reflected in the DataSet.Tables().Rows().ItemArray value, but not in the
bound DataGrid. The RowState is "Unchanged" until EndEdit() is executed, when
it becomes "Modified". The changes are reflected in the DataGrid after the
Update command has completed.
2) When changes are programmatically made to the Text property of the text
box, changes are not reflected in the DataSet, either in the ItemArray value
or visually in the DataGrid. RowState remains "Unchanged".
3) When changes are programmatically made to the DataSet Item itself, they
are visible in both the DataGrid and TextBox and RowState is "Modified" after
EndEdit().
So my question is what specifically related to the bound control causes the
RowState property to be changed to Modified? The documentation that I have
found all say that it is when the dataset is modified, but I've not seen a
more explicit definition of what that means.
I want to see the same behavior when I programmatically update the bound
TextBox as when the user types in a change (as in #1 above).
Thanks in advance....
Tim