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

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top