By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,086 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,086 IT Pros & Developers. It's quick & easy.

Saving changes in datagrid with one row.

P: n/a
I have a datagrid with just one row. When I edit the contents of the datagrid and click on Save button (somewhere else in the form), the changes are lost. However, if I click TAB from the editable column of the datagrid, the changes are saved. Is there a way to save the changes without clicking TAB button ?
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

Two steps are required:

1. Call EndEdit on the DataGrid passing "false" as the "shouldAbort"
argument value
2. Call EndCurrentEdit on the currency manager serving this grid. The
currency manager can be obtained like this:

CurrencyManager cm =
(CurrencyManager)this.BindingContext[dataGrid.DataSource,
dataGrid.DataMember];

"Sangeetha." <an*******@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
I have a datagrid with just one row. When I edit the contents of the

datagrid and click on Save button (somewhere else in the form), the changes
are lost. However, if I click TAB from the editable column of the datagrid,
the changes are saved. Is there a way to save the changes without clicking
TAB button ?

Nov 16 '05 #2

P: n/a
Thanx a ton ! It works !!
Nov 16 '05 #3

P: n/a
Dmitry,

I am facing the same problem.
one thing I dont understand -
the EndEdit method requires a column and a row number - is there a way to
EndEdit on the whole datagrid?

thanx

Picho

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:OS**************@TK2MSFTNGP11.phx.gbl...
Hi,

Two steps are required:

1. Call EndEdit on the DataGrid passing "false" as the "shouldAbort"
argument value
2. Call EndCurrentEdit on the currency manager serving this grid. The
currency manager can be obtained like this:

CurrencyManager cm =
(CurrencyManager)this.BindingContext[dataGrid.DataSource,
dataGrid.DataMember];

"Sangeetha." <an*******@discussions.microsoft.com> wrote in message
news:29**********************************@microsof t.com...
I have a datagrid with just one row. When I edit the contents of the datagrid and click on Save button (somewhere else in the form), the

changes are lost. However, if I click TAB from the editable column of the datagrid, the changes are saved. Is there a way to save the changes without clicking
TAB button ?

Nov 16 '05 #4

P: n/a
Not sure - but you can easily obtain the two through the CurrentCell (or
something similar) property.
Or, would Mr. Sangheeta be so kind to post his code snippet here? ;-)

"Picho" <pi***********@telhai.ac.il> wrote in message
news:uR**************@TK2MSFTNGP12.phx.gbl...
Dmitry,

I am facing the same problem.
one thing I dont understand -
the EndEdit method requires a column and a row number - is there a way to
EndEdit on the whole datagrid?

thanx

Picho


Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.