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

Self-Referencing Heirarchy

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 24 Mar 2011, 07:35 PM
My employer has a use case that would work great with the self-referencing heirarchy, however, the default behavior does not quite match what we want to do with it, and I'm at a loss for trying to get it working the way I want to.

Our data model is represented using objects (not DataTables or DataSources) and is bound as a list of objects to DataSource in NeedsDataSource.

1. We only want to show root nodes on the root node. From what I can tell, a simple FilterExpression on the MasterTableView fixes this.
2. We want to allow sorting, filtering, paging, grouping, etc.. I was able to fix this by turning this all on and then turning it off on the child grids on pre-render.
3. We want the filters to also apply to the child grids AND include the top level node if a child node matches. <-- this is where I get stuck. I figured a custom filter expression combined with a method on each object that returns true if that item or any child item matches would work, but it doesn't seem as if calling custom methods on the objects is allowed in FilterExpression.

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 30 Mar 2011, 09:33 AM
Hello Justin,

Since the FilterExpression property is of type string, you will have to build the correct string value prior to applying it. In addition note that the FilterExpression is a property of the GridTableView object, which means that you may have to build filter expressions for tables located in different levels at the hierarchy in order to achieve the desired filtering functionality.

I hope this helps.

Regards,
Martin
the Telerik team
Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or