View in detail section the list that is child of a class (that is a property of a class DataSource)

2 posts, 0 answers
  1. Mario
    Mario avatar
    7 posts
    Member since:
    May 2017

    Posted 24 May Link to this post

    Hello, I have these 3 classes

    Public MyClass1
    {
    Public string Name { get; set; }
    Public Class2 MyProperty { get; set; }

    }

    Public Class2
    {
    Public List<Class3> productList { get; set; }
    ...
    }

    Public Class3
    {
    Public int productCode { get; set; }
    Public string productDescription { get; set; }
    ...
    }

     

    My Object DataSource is "MyClass1". I need to list "productList" in my DetailSection but I have some errors.

    In the image below, the result expected

     

  2. Silviya
    Admin
    Silviya avatar
    344 posts

    Posted 29 May Link to this post

    Hello Mario,

    In order to display the values of a property that is a collection itself, you can bind declaratively the data item's DataSource property to a given collection property from your business object and the data item will display all collection items.

    For more information, please check How to Databind to Collection Properties KB article

    Best Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top