I have a datagrid that is bound to a dataset.
I have a "Save" button that checks the RowState of each row in the dataset to know whether to update the db or not. I have a "Cancel" button that does a RejectChanges on the dataset. This all works fine.
I want to be able to change the color of the rows that have been modified but not "Saved" yet. I also want to be able to hide the Save and Cancel buttons and only make them visible when something in the datagrid has been changed.
The problem I have is that after you change a value in the datagrid, the dataset doesn't get updated and have it's RowState property changed until after the row is changed. Is there any way to force this to happen as soon as something is typed in the datagrid instead of having to wait until the user moves to the next row or off the control?
I've got the event handlers in place so I'm able to capture the KeyPress event on the textboxes in the datagrid. I just can't seem to find a way to force the datagrid to update the dataset without switching rows.
Any ideas?
I have a "Save" button that checks the RowState of each row in the dataset to know whether to update the db or not. I have a "Cancel" button that does a RejectChanges on the dataset. This all works fine.
I want to be able to change the color of the rows that have been modified but not "Saved" yet. I also want to be able to hide the Save and Cancel buttons and only make them visible when something in the datagrid has been changed.
The problem I have is that after you change a value in the datagrid, the dataset doesn't get updated and have it's RowState property changed until after the row is changed. Is there any way to force this to happen as soon as something is typed in the datagrid instead of having to wait until the user moves to the next row or off the control?
I've got the event handlers in place so I'm able to capture the KeyPress event on the textboxes in the datagrid. I just can't seem to find a way to force the datagrid to update the dataset without switching rows.
Any ideas?