Andrus,
I have found that the .EndCurrentEdit() does not always work. Strangely enough, what seems to work correctly in this case is to Refresh the CurrencyManager. So, your code should look like this:
case Keys.Control | Keys.S:
((CurrencyManager)BindingContext[
DataSource, DataMember]).Refresh();
((BusinessForm)FindForm()).Save();
break;
~~Bonnie
>I have Winforms C# DataTable bound to DataGrid.
>User edits cell and press Ctrl+S without leaving cell.
>Edited data is not saved to database.
>When user moves to other row, save works OK.
>
>How to save without leaving cell ?
>
>I have the following code in DataGrid subclass :
>
>protected override bool ProcessCmdKey(ref Message msg, Keys keyData) {
> if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) {
>switch (keyData){
>
> case Keys.Control | Keys.S:
>
> ((CurrencyManager)BindingContext[
> DataSource, DataMember]).EndCurrentEdit();
> ((BusinessForm)FindForm()).Save();
> break;