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

InvalidOperationException when trying to filter

1 Answer 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
JDB
Top achievements
Rank 1
JDB asked on 29 Apr 2009, 01:38 PM
Hi,

In the application I'm working on, we're using CSLA.NET as the Business Object Framework. In the framework there are a couple of list classes that can be used, 2 of them are: BusinessListBase<T,C> and ReadOnlyListBase<T,C>.

In the UI I have a RadGridView bound to a list. If this list is of the type ReadOnlyListBase, everything works fine. But if I change it to a BusinessListBase, I get the following exception:

System.InvalidOperationException: No method 'OrderBy' on type 'System.Linq.Queryable' is compatible with the supplied arguments.  
   at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)  
   at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)  
   at Telerik.Windows.Data.QueryableExtensions.Ordered(IQueryable source) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\Data\Collections\QueryableExtensions.cs:line 88  
   at Telerik.Windows.Data.RecordTreeBuilder`1.GetDistinctValues(String fieldName) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\Data\Data\RecordTreeBuilder.cs:line 185  
   at Telerik.Windows.Data.RecordManager.GetDistinctValues(String fieldName) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\Data\Data\RecordManager.cs:line 294  
   at Telerik.Windows.Controls.GridView.FilteringDropDown.PopulateDistinctValues() in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Filtering\FilteringDropDown.cs:line 541  
   at Telerik.Windows.Controls.GridView.FilteringDropDown.DropDownPopupOpened(Object sender, EventArgs e) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Filtering\FilteringDropDown.cs:line 470  
   at System.Windows.FrameworkElement.RaiseClrEvent(EventPrivateKey key, EventArgs args)  
   at System.Windows.Controls.Primitives.Popup.OnOpened(EventArgs e)  
   at System.Windows.Controls.Primitives.Popup.CreateWindow(Boolean asyncCall)  
   at System.Windows.Controls.Primitives.Popup.OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)  
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)  
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)  
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)  
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)  
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)  
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)  
   at System.Windows.Controls.Primitives.Popup.set_IsOpen(Boolean value)  
   at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(Boolean oldValue, Boolean newValue) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Filtering\FilteringDropDown.cs:line 251  
   at Telerik.Windows.Controls.GridView.FilteringDropDown.OnIsDropDownOpenChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Filtering\FilteringDropDown.cs:line 126  
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)  
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)  
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)  
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)  
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)  
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)  
   at Telerik.Windows.Controls.GridView.FilteringDropDown.set_IsDropDownOpen(Boolean value) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Filtering\FilteringDropDown.cs:line 108  
   at Telerik.Windows.Controls.GridView.FilteringDropDown.DropDownButtonClick(Object sender, RoutedEventArgs e) in c:\Builds\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Filtering\FilteringDropDown.cs:line 486  
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)  
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()  
   at System.Windows.Controls.Primitives.ToggleButton.OnClick()  
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)  
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)  
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)  
   at System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)  
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)  
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)  
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)  
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)  
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)  
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)  
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)  
   at System.Windows.Input.InputManager.ProcessStagingArea()  
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)  
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)  
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)  
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)  
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)  
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)  
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) 

I tried a lot of things only to come to the conclusion that this (hopefully) is a bug in the RadGridView.

Any suggestions whether I'm wrong or if this is already known and maybe solved in a new release?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 01 May 2009, 07:18 AM
Hello RVW,

After some research we found out that this actually might be a problem with BusinessListBase's implementation of IQueryable. A fellow developer has described exactly the same problem that you are facing, i.e. everything is fine with the read-only list, but the same OrderBy problem occurs with the BusinessListBase.

The good news is that it appears that this CSLA.NET bug has been resolved in the latest version of CSLA.NET:

"Make LINQ to CSLA work with the Microsoft Dynamic Query library on a BusinessListBase."

http://www.lhotka.net/cslabugs/edit_bug.aspx?id=326 

So if you are not using the latest version, can you try upgrading. If this does not solve the problem, please do not hesitate to contact us again.

Regards,
Ross
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
JDB
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or