Solved

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

Posted on 2009-04-06
2
729 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now