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. Advertising

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. Sony Antony

    Polymorphism in xml ??

    Sony Antony, Aug 26, 2003, in forum: Java
    Replies:
    0
    Views:
    534
    Sony Antony
    Aug 26, 2003
  2. Osaman
    Replies:
    2
    Views:
    428
    John C. Bollinger
    Jan 5, 2004
  3. Tony Morris

    polymorphism

    Tony Morris, Mar 7, 2004, in forum: Java
    Replies:
    1
    Views:
    707
    sonali
    Mar 7, 2004
  4. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,944
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  5. Krivenok Dmitry
    Replies:
    13
    Views:
    1,389
    Axter
    Jun 1, 2006
Loading...

Share This Page