Home All Groups Group Topic Archive Search About

data binding and rejectchanges

Author
10 Oct 2006 4:23 PM
PJ6
If I edit more than one row in a databound DataGridView and then I want to
cancel the edits, calling the RejectChanges method in the DataTable often
does not cause the grid to revert back to the original values - and never
more than one row, when it does work.

I've tried ResetBindingSource but that seems to be really flaky and throw
inappropriate exceptions.

What's the best way to cause the grid to show reverted values without having
to load the data again?

Paul

Author
10 Oct 2006 5:24 PM
PJ6
never mind I got it

Show quoteHide quote
"PJ6" <no***@nowhere.net> wrote in message
news:uT3qxhI7GHA.660@TK2MSFTNGP03.phx.gbl...
> If I edit more than one row in a databound DataGridView and then I want to
> cancel the edits, calling the RejectChanges method in the DataTable often
> does not cause the grid to revert back to the original values - and never
> more than one row, when it does work.
>
> I've tried ResetBindingSource but that seems to be really flaky and throw
> inappropriate exceptions.
>
> What's the best way to cause the grid to show reverted values without
> having to load the data again?
>
> Paul
>
Author
15 Oct 2006 5:14 PM
Theo Verweij
And the answer was?

PJ6 wrote:
Show quoteHide quote
> never mind I got it
>
> "PJ6" <no***@nowhere.net> wrote in message
> news:uT3qxhI7GHA.660@TK2MSFTNGP03.phx.gbl...
>> If I edit more than one row in a databound DataGridView and then I want to
>> cancel the edits, calling the RejectChanges method in the DataTable often
>> does not cause the grid to revert back to the original values - and never
>> more than one row, when it does work.
>>
>> I've tried ResetBindingSource but that seems to be really flaky and throw
>> inappropriate exceptions.
>>
>> What's the best way to cause the grid to show reverted values without
>> having to load the data again?
>>
>> Paul
>>
>
>
Author
17 Oct 2006 4:57 PM
PJ6
I was using one dataset with multiple tables, I was just calling
rejectchanges on the wrong table.

Paul

Show quoteHide quote
"Theo Verweij" <tverw***@xs4all.nl> wrote in message
news:OfSdn1H8GHA.4116@TK2MSFTNGP03.phx.gbl...
> And the answer was?
>
> PJ6 wrote:
>> never mind I got it
>>
>> "PJ6" <no***@nowhere.net> wrote in message
>> news:uT3qxhI7GHA.660@TK2MSFTNGP03.phx.gbl...
>>> If I edit more than one row in a databound DataGridView and then I want
>>> to cancel the edits, calling the RejectChanges method in the DataTable
>>> often does not cause the grid to revert back to the original values -
>>> and never more than one row, when it does work.
>>>
>>> I've tried ResetBindingSource but that seems to be really flaky and
>>> throw inappropriate exceptions.
>>>
>>> What's the best way to cause the grid to show reverted values without
>>> having to load the data again?
>>>
>>> Paul
>>>
>>