Nested Properties in a GridView ASP.Net 2.0

Discussion in 'ASP .Net Web Controls' started by Eyal, Aug 11, 2006.

  1. Eyal

    Eyal Guest

    Hi.

    I am using a GridView to display records from an ObjectDataSource. My
    middle-tier layer have nested properties, meaning that I have things like
    Employee.Name.FullName, where Employee is what I am binding the grid to
    while FullName is what I want displayed.

    For some reason the GridView does not allow me to do something like
    DataField="Name.FullName". This fine in a Windows Form DataGridView, but not
    in ASP.Net GridView!

    Is this a known issue? Are there any workarounds for it? Thanks in advance,
    Eyal.
    Eyal, Aug 11, 2006
    #1
    1. Advertising

  2. Eyal

    Mikeon Guest

    > I am using a GridView to display records from an ObjectDataSource. My
    > middle-tier layer have nested properties, meaning that I have things like
    > Employee.Name.FullName, where Employee is what I am binding the grid to
    > while FullName is what I want displayed.
    >
    > For some reason the GridView does not allow me to do something like
    > DataField="Name.FullName". This fine in a Windows Form DataGridView, but not
    > in ASP.Net GridView!
    >
    > Is this a known issue? Are there any workarounds for it? Thanks in advance,


    Check out my blog at:
    http://vaultofthoughts.net/UsingBindWithNestedProperties.aspx

    Where I describe how to deal with similar issues.

    Also check out my articles on problems with ObjectDataSource:
    http://vaultofthoughts.net/ProblemsWithObjectDataSource.aspx

    and a working alternative
    http://vaultofthoughts.net/ObjectDataSourceAWorkingAlternative.aspx
    or better yet with all other controls:
    http://vaultofthoughts.net/ASPNETControlsPack.aspx

    Of course, all feedback is always welcome.

    --
    Michal
    Mikeon, Aug 17, 2006
    #2
    1. Advertising

  3. Eyal

    Eyal Guest

    Thank you Michal for the response. This is actually very similar to what we
    have came up with. However, I do consider this solution a work around the
    problem (please take no offense as we have come up with the same idea). Do
    you (or anyone else) know if there are any plans for adding this
    functionality in a future version of the grid or perhaps in an "Atlas" CTP.
    Thank you again. Eyal.

    "Mikeon" wrote:

    > > I am using a GridView to display records from an ObjectDataSource. My
    > > middle-tier layer have nested properties, meaning that I have things like
    > > Employee.Name.FullName, where Employee is what I am binding the grid to
    > > while FullName is what I want displayed.
    > >
    > > For some reason the GridView does not allow me to do something like
    > > DataField="Name.FullName". This fine in a Windows Form DataGridView, but not
    > > in ASP.Net GridView!
    > >
    > > Is this a known issue? Are there any workarounds for it? Thanks in advance,

    >
    > Check out my blog at:
    > http://vaultofthoughts.net/UsingBindWithNestedProperties.aspx
    >
    > Where I describe how to deal with similar issues.
    >
    > Also check out my articles on problems with ObjectDataSource:
    > http://vaultofthoughts.net/ProblemsWithObjectDataSource.aspx
    >
    > and a working alternative
    > http://vaultofthoughts.net/ObjectDataSourceAWorkingAlternative.aspx
    > or better yet with all other controls:
    > http://vaultofthoughts.net/ASPNETControlsPack.aspx
    >
    > Of course, all feedback is always welcome.
    >
    > --
    > Michal
    >
    >
    Eyal, Aug 18, 2006
    #3
  4. Eyal

    Mikeon Guest

    > Thank you Michal for the response. This is actually very similar to what we
    > have came up with. However, I do consider this solution a work around the
    > problem (please take no offense as we have come up with the same idea). Do
    > you (or anyone else) know if there are any plans for adding this
    > functionality in a future version of the grid or perhaps in an "Atlas" CTP.


    I do not think they will do it soon. This is not a problem with a grid.
    It is a problem with how Bind works.
    When Bind retrievs data from a data-bound field it takes the string
    representation and transforms it to your destination type. With nested
    object it would be very difficult to do it.

    --
    Michal
    Mikeon, Aug 23, 2006
    #4
    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. H5N1
    Replies:
    0
    Views:
    2,712
  2. Peter Rilling
    Replies:
    0
    Views:
    432
    Peter Rilling
    May 15, 2006
  3. =?Utf-8?B?SmltUQ==?=

    ASP.Net tabel nested in another ASP.Net table

    =?Utf-8?B?SmltUQ==?=, Mar 23, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    1,731
    =?Utf-8?B?SmltUQ==?=
    Mar 23, 2007
  4. HeavyMetal

    GridView RowCommand problem: GridView Nested in Repeater

    HeavyMetal, Aug 8, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    799
    HeavyMetal
    Aug 8, 2006
  5. Craig Buchanan
    Replies:
    0
    Views:
    162
    Craig Buchanan
    Aug 22, 2007
Loading...

Share This Page