Polymorphism in GridView (ASP.Net 2.0)

K

Kevin Lawrence

Hi all

I have 2 classes derived from Person - they are Employee and Customer, Person
class contains FirstName and LastName properties.

However, when I have an array of Person and try to bind to a GridView it
fails, it's fine with the first object it hits but then if the next object
is o f a different class it fails.

Is what I am trying to achieve not possible because they are 2 different
classes - even though they are cast as their parent class?

Thanks
Kev
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top