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

Self-referencing RadGridView with non-trivial ViewModel

1 Answer 59 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 13 Aug 2015, 09:59 PM

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()

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Aug 2015, 08:29 AM
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.

Regards,
Stefan X1
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
Tags
GridView
Asked by
Mike
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or