Column values not displayed properly when binding to a DataSet or custom objects

2 posts, 0 answers
  1. immitev
    immitev avatar
    9 posts
    Member since:
    Nov 2006

    Posted 01 Dec 2008 Link to this post

    I have a grid that binds to hierarchical objects in the Load() handler of a ascx control:

     grid.MasterTableView.DataSource = masterTable; // a table from a typed DataSet
      grid.MasterTableView.DetailTables[0].DataSource = childTable; // a table from a typed DataSet

    The grid.DataBind() is called later.

    The grid has defined a bunch of bound columns using GridBoundColumn (Name, Description, etc.). The hierarchy gets displayed correctly (there are parent/child rows), but the values of the columns are always "System.Data.DataRowView" and this does not make sense, since the tables contains the rows Name, Description... I have inspected in debug mode the items in ItemDataBound event and they seem OK.

    I tried an alternative implementation with binding to objects, but I am getting similar results - I jsut have the class name displayed instead of "System.Data.DataRowView" .

    Any ideas? Is the binding problematic or something else?
  2. immitev
    immitev avatar
    9 posts
    Member since:
    Nov 2006

    Posted 01 Dec 2008 Link to this post

    Well, I forgot to set DataField to the GridBoundColumn - no wonder it did not show any data
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top