TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Eddie Fisher
NA
3
0
data source based on custom business objects
Oct 21 2006 12:37 PM
I have a problem that's bugging me for a month now. I hope someone can help me solve it. I'm trying to make a data source based on some classes and bind it to a BindingSource object. The classes: public class City { private Int32 _ID; private string _Name; ... } public class Customer { private Int32 _ID; private string _FirstName; private string _LastName; private City _LivesIn; ... } public class CustomerList : System.Collections.CollectionBase { ... } Here's what I've been doing: 1. create a data source based on the Customer class and drag it on a form (creates a binding source) 2. on the form load event create an instance of the CustomerList class and load all the customers from the database 3. set the binding source's data source property to the CustomerList object 4. bind a data grid view to the binding source The Problem: In the data grid I can't display the name of the city for each customer. All I get is "MyNamespace.LivesIn". I tryed to create a new column with a lookup combo box, as with datasets, but it didn't work.
Reply
Answers (
3
)
revert to last successful build
Help with Microsoft Visual C# Express Edition publishing wizard