Click here to Skip to main content
16,016,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a simple test Access database with a 'ColA' and 'ColB'. Populated it with junk test string values. Then I created a VS C# .Net forms project and added a binding source pointing to that DB, and added a DataGridView and a BindingNavigator.

After pointing the DataGridView and the BindingNavigator to the DataSet IN THE DESIGNER, when the form is executed the populated data appears in the DataGridView.

But it seems to only be a one way relationship. If I change a value in the grid, it isn't updated in the DB. Is it possible to make it a two-way communication, and if so, how?

(I imagine I can handle cell leaving events and such, and do it through queries, but I thought databinding was supposed to eliminate some of that hassle.)

What I have tried:

I've tried following along with A Detailed Data Binding Tutorial[^], but it doesn't really delve into using the designer in this way, unless I've overlooked something.
Posted
Updated 28-Jan-21 7:56am

1 solution

Maybe you can try with INotifyPropertyChanged, see CodeProject article:
Bind Better with INotifyPropertyChanged[^]
 
Share this answer
 
Comments
David O'Neil 29-Jan-21 11:42am    
So it isn't just a non-understanding on my part, but a limitation of DataGridView. Thanks! And thanks for the link.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900