Polymorphism in GridView (ASP.Net 2.0)

Discussion in 'ASP .Net' started by Kevin Lawrence, Feb 16, 2006.

  1. 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
     
    Kevin Lawrence, Feb 16, 2006
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    3
    Views:
    1,548
  2. Kivak Wolf
    Replies:
    2
    Views:
    10,307
    Kivak Wolf
    Jun 28, 2005
  3. Andrea Raimondi
    Replies:
    1
    Views:
    740
  4. Sony Antony

    Polymorphism in xml ??

    Sony Antony, Aug 26, 2003, in forum: Java
    Replies:
    0
    Views:
    692
    Sony Antony
    Aug 26, 2003
  5. Osaman
    Replies:
    2
    Views:
    628
    John C. Bollinger
    Jan 5, 2004
  6. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,296
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  7. Krivenok Dmitry
    Replies:
    13
    Views:
    1,758
    Axter
    Jun 1, 2006
  8. Amelyan
    Replies:
    2
    Views:
    384
    Amelyan
    Apr 25, 2005
Loading...