Update current row in Datagrid

  • Thread starter Thread starter MB
  • Start date Start date
M

MB

Hello!

When running dataadapter.update current row in my datagrid is not updated.
I want the current row to be updated without having to move to another row
in my datagrid.

Any ideas?
Regards Magnus
 
Hi Magnus,

Try you may try calling EndCurrentEdit method on the corresponding currency
manager before executing the Update method.
The follow code snippet shows the idea
<code>
CurrencyManager cm = BindingContext[dataGrid1.DataSource,
dataGrid1.DataMember] as CurrencyManager;
cm.EndCurrentEdit();
</code>
You may put these code in an event handler such as focus_leave,
button_click etc.
But you should avoid calling it when you are editing in the datagrid.

Please reply this thread to let me know if my suggestion works for you.
Thanks!


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
Back
Top