Object DataSource and Grid View RRS feed

  • Question

  • User-1208756302 posted


    i have a method that results a Class object that hold (propertis + list) 

    after adding ObjectSource in webform i associated Object Datasource with Grid view. its selecting values and showing in data Grid but problem is Data Grid is not showing values that are in List

    i have tried to add Template field and then put another Grid to hold all values that is in List but it didnt worked

    can some one help me out ??? how i can achieve this .

    Sunday, July 17, 2011 12:32 AM


All replies

  • User-2005691517 posted

    Can you post your code?

    Sunday, July 17, 2011 12:43 AM
  • User-1208756302 posted

    public List<Item> GetAllItems(int id)
               return new ItemDAL().GetItems(id);

    it return . List<item>

    that holds values Like ( Name, Price, ImageUrl, Rank, Avg. Rating , Features ( SerianlNo, Weight, Model no))

    Features is a list of type ItemFeature . so my Method return a list that hold another list

    Now when i join it with GridView it shows Name Price ImageUrl Rank but dont show Features (bcz its a list) dats y i have to use Nested Grid to show my Features data .

    Sunday, July 17, 2011 12:58 AM
  • User3866881 posted

    maybe you should also use another GridView or data presentation control to do with that. A simple databinding cannot do to directly show a list/collection of sth.

    Hope http://www.codeguru.com/columns/vb/article.php/c12647

    this helps!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, July 18, 2011 10:41 PM