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

The method or operation is not implemented error when we set the filter to "StartsWith"

1 Answer 437 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 13 Apr 2016, 03:36 PM

Hi,

We are using RadGridView to display data from the DataTable. In one of the column we have selected "StartsWith" has the filter. After setting the filter if we close and re open the view, we are getting the following error and the application crashes. This is once we load the layout even before Data is loaded.

 

System.NotImplementedException: The method or operation is not implemented.
   at Telerik.Windows.Data.Expressions.FilterOperatorExpressionBuilderBase.GenerateStartsWith(Expression left, Expression right)
   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpression()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
   at Telerik.Windows.Data.ICompositeFilterDescriptorExtensions.GetFilterFunction(ICompositeFilterDescriptor filterDescriptors, Type itemType)
   at Telerik.Windows.Data.QueryableCollectionView.InitializeInternalList(IQueryable view)
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator()
   at System.Linq.Enumerable.<OfTypeIterator>d__aa`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

 

After digging through the column properties, I found out that FilterMemberType was null. Once I set the property to string type. Its not throwing error anymore.

Please let me know is it the right way to do it or if you have any better solution.

 

Thanks and regards,

Alex

 

 

 

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 15 Apr 2016, 10:51 AM
Hello Alex,

Generally, when the Type of the bound property cannot be automatically discovered by the data engine, you can “help” the column by setting the FilterMemberType property. So, your approach is the correct one.

Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Alex
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or