Hierarchical data model and tree structure

4 posts, 0 answers
  1. Hasanain
    Hasanain avatar
    8 posts
    Member since:
    Jun 2012

    Posted 23 Jul 2012 Link to this post

    I would like to know how to display the following view model 

    public class AssetClassLevelViewModel
    {    
         
    public string AssetClassName {get; set;}

         
    public ObservableCollection<AssetClassLevelViewModel> ChildAssetClasses {get; set;}

         
    public ObservableCollection<ProductHoldingsWithAllocationViewModel> ProductHoldings {get; set;}

    }
    The ProductHoldingsWithAllocationViewModel has properties such as ProductName etc., which are to be displayed in columns. Attached is a sample of what it should look like.

    The AssetClass in the picture is in the AssetClassLevelViewModel, and each of the Products is represented by the ProductHoldingsWithAllocationViewModel.

    I would like to know if this is possible, if we are to use the RadTreeListView.

    Thank You

  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 24 Jul 2012 Link to this post

    Hi,

    From the screenshot description priovided I tend to believe a RadGridView with Row details  may be a better fit to your scenario.

    Kind regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Hasanain
    Hasanain avatar
    8 posts
    Member since:
    Jun 2012

    Posted 25 Jul 2012 Link to this post

    Hi 

    I basically have a hierarchy as seen in the view model code I included earlier, and each level in the hierarchy can have one or more product holding objects. 

    The properties are at the product holding objects, therefore the columns will reflect the properties of these objects. The column headers should only be at the top of the grid and not repeated at any level in the hierarchy.

    The RowDetail you indicated, in our case, would essentially be a table/grid whose columns would reflect the properties of the product holding objects. Can those column headers be moved to the top of the grid and not repeated at every occurrence of RowDetail?

    It's essentially a hierarchical tree combined with a grid, except that the object types in the hierarchy and grid are different.

    The viewModel for the grid would be:

    public class GridViewModel
    {
    public ObservableCollection<AssetClassLevelViewModel> GridRows { get; set; }
    }


    Thanks

    Hasanain
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 30 Jul 2012 Link to this post

    Hi,

    RadGridView does not support such view  where the child headers can me moved to the top. We can actually place some fake headers under the normal ones - at least visually it is not a challenge.
    However those headers can not be linked logically to the child grids and perform column resizing.

    In case you are willing to sacrifice the column resizing behavior , i can show you a way to hide the headers from the child grids and show  some fake headers under the regular ones.

    Kind regards,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top