开发者

Using more than one filter in CollectionViewSource

On my code i have itemsControl and i want to filter the items that are pressent.

SO, I define CollectionViewSource and i wrote this code :

        CollectionViewSource view = new CollectionViewSource();
        view.Source = myItemCollection;
        view.Filter += ( s, e ) =>
        {
            e.Accepted = ( ( myItem )e.Item ).FilterFiels.Equals( stringFilter );
        };

        itemsControl.SetBinding( ItemsControl.ItemsSourceProperty, new Binding()
        {
            Source  = vi开发者_开发百科ew
        } );

Now, I want to use more than one filter in my code. That mean that i want to use filter stringFilter_1 and stringFilter_2

How can i do it ?


Just compound your filter expression with appropriate conditional operators (i.e. && and ||)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜