Binding a collection based on ICollectionView to the GridView would cause the System.Reflection.TargetException “Non-static method requires a target” to be thrown.
That interface has a member called GroupDescriptions, that according to the MSDN “The value of this property is always a null reference”. This behaviour causes the GridViewDataControl.OnApplyTemplate chain to throw this exception.
By following the stack, the BindDescriptorsToDescriptions constructor uses the parameter right of ConvertingObservableCollectionManager.Track method, which has the parameter value set by the original ICollectionView.GroupDescriptions value, which is null.
Implementors of this Interface may not fill this value, assuming that others will do.
The example uses the class EntityCollectionView provided by the following article: http://blogs.msdn.com/b/brada/archive/2009/09/07/business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update-viewmodel.aspx.
A check on the availability of the GroupDescriptions would be provided.
Here is the stack trace:
Telerik.Windows.Data!Telerik.Windows.Data.WeakEvent.WeakListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.Listen<System.Collections.Specialized.INotifyCollectionChanged>(sender, eventName) Line 48 Telerik.Windows.Data!Telerik.Windows.Data.WeakEvent.InternalSubscribe<System.Collections.Specialized.INotifyCollectionChanged,System.Collections.Specialized.NotifyCollectionChangedEventArgs>(eventName, sender, listener) Line 85
Telerik.Windows.Data!Telerik.Windows.Data.WeakEvent.Subscribe<System.Collections.Specialized.INotifyCollectionChanged,System.Collections.Specialized.NotifyCollectionChangedEventArgs>(eventName, sender, listener) Line 90 + 0x37 bytes C#
Telerik.Windows.Data!Telerik.Windows.Data.ObservableCollectionManager.ObservableCollectionManager(left, right) Line 59 + 0x20 bytes
Telerik.Windows.Data!Telerik.Windows.Data.ObservableCollectionManager.Track(left, right, comparer) Line 46 + 0x1d bytes
Telerik.Windows.Data!Telerik.Windows.Data.DataItemCollection.BindCollections(localCollection, foreignCollection, comparer) Line 829 + 0x10 bytes
Telerik.Windows.Data!Telerik.Windows.Data.DataItemCollection.SetItemsSource(source) Line 743
Telerik.Windows.Controls.GridView!Telerik.Windows.Controls.GridView.GridViewDataControl.Bind.AnonymousMethod__17() Line 3511
Telerik.Windows.Controls!Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(frameworkElement, action) Line 16 + 0xb bytes
Telerik.Windows.Controls.GridView!Telerik.Windows.Controls.GridView.GridViewDataControl.Bind(newValue) Line 3540
Telerik.Windows.Controls.GridView!Telerik.Windows.Controls.GridView.GridViewDataControl.OnApplyTemplate() Line 2931