views:

9

answers:

1

Hi All,

I'have a datagrid and a dataform. I'm assigning data to DataForm with currently selected Item in the datagrid individually as DataForm.CurrenItem. This means that I do not have any Next/Previous button on the DataForm and user can switch to any row in the datagrid.

My problem is that Although I have set the Property AutoCommit="True" on DataForm but as the user edits something and clicks on another record in the grid it crashes.

My question is How can I forcelt save the DataForm when the user moves away from that form.

A: 

I got this working but not sure whether this is correct or not. On SelectionChanged event of datagrid i added the following:-

DataForm.CommitEdit();

and it stopped crashing and giving me the error. Anyone else have better sol please do let me know.

Thanks in advance

Jhelumi

related questions