473,396 Members | 2,108 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

data binding and rejectchanges

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
Oct 10 '06 #1
3 2199
PJ6
never mind I got it

"PJ6" <no***@nowhere.netwrote in message
news:uT*************@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

Oct 10 '06 #2
And the answer was?

PJ6 wrote:
never mind I got it

"PJ6" <no***@nowhere.netwrote in message
news:uT*************@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

Oct 15 '06 #3
PJ6
I was using one dataset with multiple tables, I was just calling
rejectchanges on the wrong table.

Paul

"Theo Verweij" <tv******@xs4all.nlwrote in message
news:Of**************@TK2MSFTNGP03.phx.gbl...
And the answer was?

PJ6 wrote:
>never mind I got it

"PJ6" <no***@nowhere.netwrote in message
news:uT*************@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
Oct 17 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Maurice Mertens | last post by:
Hi, I'm having a form with a bound control "ID" and it's bound to an Access database. The field ID is an autonumbering field. When I add a new record, the ID is numbered 1 up, for example from...
0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
11
by: Marina | last post by:
Hi, I have a text control bound to a column that is of type Decimal. I am doing the validation myself to see if the user typed in something invalid, calling CancelCurrentEdit and cancelling the...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
9
by: Anil Gupte | last post by:
After reading a tutorial and fiddling, I finally got this to work. I can now put two tables created with a DataTable class into a DataRelation. Phew! And it works! Dim tblSliceInfo As New...
2
by: inadsad | last post by:
Hi Group, I have a form with textboxe, maskedit controls including two buttons (Add, Cancel). Controls are bound to a dataset as follows: txtName.DataBindings.Add(New Binding("Text",...
2
by: lily86 | last post by:
i'm very new so i hope all of u can help me. when i debug my webforms this error occur "An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Additional...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.