Solved

How do I tell a DataGridView to perform 'CRUD' on Business Object Collection

Posted on 2009-04-06
2
740 Views
Last Modified: 2012-06-21
Hello,

I have a DataGridView that is bound to a collection of custom business objects (Product) via a BindingSource.  So far I have been able to display the list of the business objects, but what I don't know how to do is to write the code that would for instance insert a new record into the collection from the DGV or update an edited row so that the changes are persisted in the BO's underlying database.  Does anyone have any thoughts on how I might get this done?

Thanks,

Mike C
0
Comment
Question by:MClarkCCR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 24083576
I would bind the DataGridView to a BindingList(Of BusinessObject).
0
 
LVL 3

Author Comment

by:MClarkCCR
ID: 24103776
TheLearnedOne,

Thanks for the response.  At the moment I've decided just to give into Microsoft and use their dataset designer and typed datasets to data bind all my controls.  There are just too many hurdles to jump rolling your own collections and trying to create a business layer, too many at least to be helpful for a small app like mine.  I'm a bit more than disappointed, however, as I was hoping to use this app as a good tool for learning how to design software into 3-layers which I could have expanded much easier in the future.

Mike C.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question