Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2005

Tip: Looking for answers? Try searching our database.

Second post: Can someone help

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
consumer62000@yahoo.com - 06 Jul 2005 01:14 GMT
I have 2 questions:
1. I have a base class called
class MyBaseObject
{

}

All my classes are derived from MyBaseObject.
I also have a collection dervied from IBindingList and CollectionBase
like so,
class MyCollection : CollectionBase,IBindingList
{
...

}

I also have a class called Customer derived from MyBaseObject
class Customer: MyBaseObject
{
public CustomerId
{
get { return _CustomerId;}
set { _CustomerId  = value;}

}

Now I add a few customers to my collection class.
MyCollection myColl  = new MyCollection();

myColl.Add ( new Customer(1));
myColl.Add ( new Customer(2));
myColl.Add ( new Customer(3));

At some point in the form, I attach the collection to the datagrid

datagrid1.Datasource = myColl;

Problem:
I see the number of rows in the datagrid to be 3 ( left side sticky
col) but I don't see the columns.
I know the problem. My Customer class is derived from MyBaseObject
class and MyBaseObject doesnot have any public properties.
If I remove MyBaseObject from the picture by not deriving Customer from

MyBaseObject, everything works fine : I see CustomerId column being
displayed on the grid.

You must have guessed my question. How do I take care of the problem.

Thanks for reading the post.
Eric Renken - 06 Jul 2005 02:32 GMT
I tried doing this a while back myself, and you need a lot more then just
the IBindingList interface.  I would recommend a book:

Expert C# Business Objects
Rocky Lhotka
ISBN: 1-59059-344-8

He spoke at our local user group last year and it was great.  This book
should have everything in it you need.  He even has created his own
framework that might help you get to where you are going faster.

Hope this helps.

Eric Renken

>I have 2 questions:
> 1. I have a base class called
[quoted text clipped - 46 lines]
>
> Thanks for reading the post.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.