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

filtering problem

2 Answers 143 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Adam Walocha
Top achievements
Rank 1
Adam Walocha asked on 20 Aug 2009, 01:04 PM
i get following exception while trying to filter at runtime using UI:
"'System.Object' is not a valid metadata type for type filtering operations. Type filtering is only valid on entity types and complex types."
           
When i add filter in code :
FilterDescriptor fd=new FilterDescriptor("nazwa",FilterOperator.Contains,"GT");
view.FilterDescriptors.Add(fd);
everything works.

binding code:             QueryableCollectionView view = new QueryableCollectionView(presenter.Model.EntityList);
            view.PageSize = 1000;
            SortDescriptor sd=new SortDescriptor();
            sd.Member = "nazwa";
            sd.SortDirection = System.ComponentModel.ListSortDirection.Ascending;
            view.SortDescriptors.Add(sd);
            radGridView1.ItemsSource = view;

presenter.Model.EntityList contains objects that derive from EntityObject(so i think they are of "entity type" ).
What should i do to avoid this problem?


2 Answers, 1 is accepted

Sort by
0
Adam Walocha
Top achievements
Rank 1
answered on 21 Aug 2009, 08:00 AM
I found solution for one case ( http://www.telerik.com/community/forums/wpf/gridview/filter-crashes.aspx ), but in one situation given workaround won't help - when i use QueryableCollectionView i can pass to constructor IEnumerable List ( that is returen by method ToList() ) but i will lose virtualization - creation of Enumerator will query all records form DB ;/  When do you plan to fix this bug?

Anyway even if i cast my IQuerable list to enumerable list, filtering doesn't works correctly, p.e.  when i try to set filter (from UI ) for decimal field and type condition "less than 100 ", grid throws exc:
"Object reference not set to an instance of an object." at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()

similar exc is thrown when i check some values from checkboxList in filterwindow.:
"Object reference not set to an instance of an object."  at Telerik.Windows.Data.QueryableCollectionView.GetEnumerator()
0
Stefan Dobrev
Telerik team
answered on 25 Aug 2009, 02:12 PM
Hi Adam,

I was able to reproduce the problem you have described. The good news is that a fix will be available for the next internal release.

Thanks for reporting this issue. I have updated your telerik points.

Sincerely yours,
Stefan Dobrev
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
Adam Walocha
Top achievements
Rank 1
Answers by
Adam Walocha
Top achievements
Rank 1
Stefan Dobrev
Telerik team
Share this question
or