data binding inherited properties

Discussion in 'ASP .Net Datagrid Control' started by Chris Perry, Jan 17, 2004.

  1. Chris Perry

    Chris Perry Guest

    Hello all,

    My problem is simply that I need to be able to show inherited members in my
    datagrid but only the members defined in that type are showing up.

    Heres my problem :

    //dg = my datagrid
    dg.DataSource =
    ((Respondant)e.Item.DataItem)[15].Jobs.ToArray(typeof(JobType)); // Jobs is
    an ArrayList
    Response.Write(dg.DataSource); // Showing as JobTypeExtra the inherited type
    dg.AutoGenerateColumns = true; // only 'Benefits' the non inherited property
    shows up

    Furthermore if I do not generate the columns and instead do it myself

    BoundColumn dgc = new BoundColumn();
    dgc.DataField = "BasicWage";
    dg.Columns.Add(dgc);

    I get A field or property with the name 'BasicWage' was not found on the
    selected datasource.

    Any insight or workarounds gratefully recieved.

    Thanks,

    Chris.
     
    Chris Perry, Jan 17, 2004
    #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. Kelthar
    Replies:
    0
    Views:
    447
    Kelthar
    Jan 16, 2006
  2. Alex Sab
    Replies:
    1
    Views:
    353
    C. M. Sperberg-McQueen
    May 1, 2004
  3. Victor Porton
    Replies:
    1
    Views:
    706
    Steven T. Hatton
    Aug 29, 2004
  4. =?Utf-8?B?TWF0dEJlbGw=?=
    Replies:
    2
    Views:
    348
    =?Utf-8?B?TWF0dEJlbGw=?=
    Aug 10, 2006
  5. 7stud --
    Replies:
    11
    Views:
    427
    7stud --
    Nov 9, 2007
Loading...

Share This Page