This is a migrated thread and some comments may be shown as answers.

Hierarchical data model and tree structure

3 Answers 83 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Hasanain
Top achievements
Rank 1
Hasanain asked on 23 Jul 2012, 02:16 PM
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

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 24 Jul 2012, 02:18 PM
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.

0
Hasanain
Top achievements
Rank 1
answered on 25 Jul 2012, 06:07 PM
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
0
Pavel Pavlov
Telerik team
answered on 30 Jul 2012, 02:25 PM
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.

Tags
TreeListView
Asked by
Hasanain
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Hasanain
Top achievements
Rank 1
Share this question
or