Page 1 of 1

Collection view source and filtering data.

Posted: Wed 03 Dec 2014 13:47
by Massimiliano.Modena
Hi.
I'm using MySqlConnect with LinqToSql.
I'm replacing all old entities in my software with the DevArt version.
I've a little problem.
I'm using Wpf datagrid with a Extension for filtering data. This extension use ColelctionView filter method for filtering data. If I apply filter, it thrown an System Not Supported exception.
ICollectionView is the default object for interacting with wpf object.
It's my error or it's a bug?
Little example:

Code: Select all

 MessaggeDataContext ctx = new MessaggeDataContext ();

[...]
 ICollectionView view = CollectionViewSource.GetDefaultView(ctx.Table);
// here the error will spawn. 
      view.Filter = item =>
      {
        
        return true;

      };
There's better method to filtering data without re-write all my application?

edit:
Also using DataAdapter and DataSet I've same error

Re: Collection view source and filtering data.

Posted: Thu 04 Dec 2014 12:12
by MariiaI
Please refer to this article:
http://msdn.microsoft.com/en-us/library ... 10%29.aspx
Simpler implementations do not support filtering and throw a NotSupportedException. Use the CanFilter property to test if filtering is supported before assigning this property with a non-null value.

To solve the issue you can try using this code:

Code: Select all

[...]
var list = ctx.Table.ToList();
ICollectionView view = CollectionViewSource.GetDefaultView(list);
[...]
Please tell us if this helps.

Re: Collection view source and filtering data.

Posted: Tue 09 Dec 2014 14:18
by xam8re
MariiaI wrote:Please refer to this article:
http://msdn.microsoft.com/en-us/library ... 10%29.aspx
Simpler implementations do not support filtering and throw a NotSupportedException. Use the CanFilter property to test if filtering is supported before assigning this property with a non-null value.

To solve the issue you can try using this code:

Code: Select all

[...]
var list = ctx.Table.ToList();
ICollectionView view = CollectionViewSource.GetDefaultView(list);
[...]
Please tell us if this helps.
Yes, with ToList(), work fine. But with ToList() i'll loose virtualization engine.

I'd tryed also with DataSet and DataAdapter and i'd get same error.
If I switch to Default MySql connector, it work fine.

Re: Collection view source and filtering data.

Posted: Thu 11 Dec 2014 06:36
by MariiaI
Thank you for the response. Most likely, the issue is no related to dotConnect for MySQL/LinqConnect (please see the link we've posted above). However, we will investigate this behaviour more clearly and inform you about the results as soon any are available.

Re: Collection view source and filtering data.

Posted: Tue 27 Jan 2015 10:45
by xam8re
MariiaI wrote:Thank you for the response. Most likely, the issue is no related to dotConnect for MySQL/LinqConnect (please see the link we've posted above). However, we will investigate this behaviour more clearly and inform you about the results as soon any are available.
Any news?
It's strictly relate to dotConnect.

Re: Collection view source and filtering data.

Posted: Thu 29 Jan 2015 12:01
by MariiaI
The investigation is in progress.
This extension use ColelctionView filter method for filtering data. If I apply filter, it thrown an System Not Supported exception.
...
I'd tryed also with DataSet and DataAdapter and i'd get same error.
Please send us your test project that reproduces this behaviour. This will significantly speed up the process of finding the solution for you. Please also send us a working example with MySqlConnector.