Self-referencing RadGridView with non-trivial ViewModel

2 posts, 0 answers
  1. Mike
    Mike avatar
    1 posts
    Member since:
    Apr 2015

    Posted 13 Aug 2015 Link to this post

    My ItemsSource is a list of records with a Properties bag, rather than having convenient top-level properties

    Attempts to define the relationship like this do not work (see error below). Is there some other mechanism?

          var p = new FieldDescriptorNamePair
            ParentFieldDescriptorName = "Properties[\"OrderId\"].Value",
            ChildFieldDescriptorName  = "Properties[\"ParentOrderId\"].Value"



      Object reference not set to an instance of an object.
    --- Stack Trace
       at Telerik.Windows.Data.HierarchyFilter`1.<>c__DisplayClass6.<CreateFilterLambda>b__4(TElement r1)
       at Telerik.Windows.Data.HierarchyFilter`1.CompareValues(TElement record)
       at Telerik.Windows.Data.HierarchyFilter`1.<FilteredData>b__8(TElement d)
       at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()

  2. Stefan
    Stefan avatar
    1073 posts

    Posted 18 Aug 2015 Link to this post

    Hello Mike,

    The supported approach for defining such relation is discussed in the Self-Referencing GridView topic. Can you please take a look at it? Basically, you need to set the ParentFieldDescriptorName and ChildFieldDescriptorName to be directly the name of a given property.

    Stefan X1
    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