﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Mon, 05 May 2014 05:17:51 GMT</pubDate><dc:creator>xiaoyuandlg</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(22, 95, 167);"&gt;I happened to see this post and I was quite attracted by this problem on the &lt;a href="http://www.kettic.com/winforms_ui/csharp_guide/gridview_filtering.shtml" style="text-decoration: none;" target="_blank"&gt;gridview filtering&lt;/a&gt;. Though to read this passage spend me much time, I think I gained a lot on the &lt;a href="http://www.kettic.com/winforms_ui/gridview.shtml" target="_blank" style="text-decoration: none;"&gt;gridview component&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Wed, 19 Sep 2012 21:20:11 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Glad to hear the good news.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Should you need further assistance or run into any problems regarding our controls, feel free to post it into the community site. We would be happy to assist you again.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Wed, 19 Sep 2012 08:46:30 GMT</pubDate><dc:creator>ismailiich@gmail.com</dc:creator><description>&lt;p&gt;Many Thanks Yudi and Team,&lt;/p&gt;&lt;p&gt;This solved the filtering problem.&lt;/p&gt;</description></item><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Wed, 19 Sep 2012 04:10:59 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Thank you for the snippet code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I made a test project based on the snippet code. I was able to get the data displayed in UXGridView; sorting the data, but somehow unable to apply the filter. First thing that I suspect was the use of struct instead of class. Unfortunately this is not proven.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed the view (UXPage1.xaml file) and the view model (UXPage1ViewModel.cs file) of my sample to be evaluated. Please let me know your feedback if there is anything that I miss in the sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I will have the sample forwarded to UXGridView development team to be investigated further. Should I heard any news from the team regarding this, I will update this thread.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;&lt;strong&gt;Edited on September 19, 2012 4:57 AM.&lt;br /&gt;Reason: Update solution.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I have a good news regarding the filtering problem on UXGridView.&lt;/span&gt;&lt;/p&gt;&lt;blockquote&gt;...You typically use a collection that implements &lt;strong&gt;IPagedCollectionView&lt;/strong&gt; as the data source. The &lt;strong&gt;IPagedCollectionView&lt;/strong&gt; provides paging, sorting and filtering support to the underlying collection. You can bind the UXGridView to any &lt;strong&gt;IEnumerable&lt;/strong&gt; collection; however, the UXGridView will behave as if the data is all on a single page. To provide paging, sorting and filtering functionality for an &lt;strong&gt;IEnumerable&lt;/strong&gt; collection, you can wrap the collection in a PagedCollectionView instance...&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Source: &lt;a href="http://www.intersoftpt.com/Support/ClientUI/Docs/HowtoPerformClientSideSortingFilteringandPagingusingUXGridView.html"&gt;How-to: Implement Client-side Sorting, Filtering and Paging using UXGridView&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Solution: wrap the collection in a PagedCollectionView instance. Please modify the ViewModel by adding the following line.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;private PagedCollectionView _pagedCollectionView;
public PagedCollectionView PagedCollectionView { get; set; }&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Wrap the collection in a PagedCollectionView instance.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;public void LoadData()
{
    this.GridDatafin = new ObservableCollection&amp;lt;MyData&amp;gt;()
    {
        new MyData { keyword = "keyword0", sources = "sources0" },
        ...
        new MyData { keyword = "keyword8", sources = "sources8" },
        new MyData { keyword = "keyword9", sources = "sources9" }
    };
    this.PagedCollectionView = new PagedCollectionView(this.GridDatafin);
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed the modified of my sample project for reference.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Mon, 17 Sep 2012 03:53:05 GMT</pubDate><dc:creator>ismailiich@gmail.com</dc:creator><description>&lt;p&gt;Here is the observeable collection&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;ObservableCollection&amp;lt;MyData&amp;gt; GridDatafin = new ObservableCollection&amp;lt;MyData&amp;gt;();&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;Here is struct&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt; public struct MyData
        {
            private string m_keyword;
            private string m_sources;
            
            public string keyword
            {
                get
                {
                    return this.m_keyword;
                }
                set
                {
                    this.m_keyword = value;
                }
            }
            public string sources
            {
                get
                {
                    return this.m_sources;
                }
                set
                {
                    this.m_sources = value;
                }
            }
            
        }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;Here is XAML for gridview and custom filtering&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;&amp;lt;Intersoft:UXGridView Name="uXGridView1"  SelectionUnit="Row" AutoGenerateColumns="False"  CanUserFilterColumns="True" CanUserExport="True" VerticalAlignment="Stretch" Height="478"&amp;gt;
                        &amp;lt;Intersoft:UXGridView.Columns&amp;gt;
                            &amp;lt;Intersoft:UXGridViewTextColumn  Header="Keyword" CanUserFilter="True" CanUserSort="True"  Width="300" Binding="{Binding keyword}"&amp;gt;
                               
                            &amp;lt;/Intersoft:UXGridViewTextColumn&amp;gt;
                            &amp;lt;Intersoft:UXGridViewTextColumn Header="Sources" CanUserSort="True"  CanUserFilter="True" Width="120"   Binding="{Binding sources}" &amp;gt;
                                &amp;lt;Intersoft:UXGridViewTextColumn.FilterItems&amp;gt;
                                    &amp;lt;Intersoft:UXDataFilterItem Content="Google"&amp;gt;
                                        &amp;lt;Intersoft:UXDataFilterItem.Filter&amp;gt;
                                            &amp;lt;Intersoft:CompositeFilterDescription LogicalOperator="And" &amp;gt;
                                                &amp;lt;Intersoft:FilterDescription PropertyName="sources" Operator="IsEqualTo"  Value="Google"/&amp;gt;
                                            &amp;lt;/Intersoft:CompositeFilterDescription&amp;gt;
                                        &amp;lt;/Intersoft:UXDataFilterItem.Filter&amp;gt;
                                    &amp;lt;/Intersoft:UXDataFilterItem&amp;gt;
                                    &amp;lt;Intersoft:UXDataFilterItem Content="Yahoo"&amp;gt;
                                        &amp;lt;Intersoft:UXDataFilterItem.Filter&amp;gt;
                                            &amp;lt;Intersoft:CompositeFilterDescription LogicalOperator="And" &amp;gt;
                                                &amp;lt;Intersoft:FilterDescription PropertyName="sources" Operator="IsEqualTo"  Value="Yahoo"/&amp;gt;
                                            &amp;lt;/Intersoft:CompositeFilterDescription&amp;gt;
                                        &amp;lt;/Intersoft:UXDataFilterItem.Filter&amp;gt;
                                    &amp;lt;/Intersoft:UXDataFilterItem&amp;gt;
                                    &amp;lt;Intersoft:UXDataFilterItem Content="Bing"&amp;gt;
                                        &amp;lt;Intersoft:UXDataFilterItem.Filter&amp;gt;
                                            &amp;lt;Intersoft:CompositeFilterDescription LogicalOperator="And" &amp;gt;
                                                &amp;lt;Intersoft:FilterDescription PropertyName="sources" Operator="IsEqualTo"  Value="Bing"/&amp;gt;
                                            &amp;lt;/Intersoft:CompositeFilterDescription&amp;gt;
                                        &amp;lt;/Intersoft:UXDataFilterItem.Filter&amp;gt;
                                    &amp;lt;/Intersoft:UXDataFilterItem&amp;gt;
                                &amp;lt;/Intersoft:UXGridViewTextColumn.FilterItems&amp;gt;
                            &amp;lt;/Intersoft:UXGridViewTextColumn&amp;gt;
                           
                        &amp;lt;/Intersoft:UXGridView.Columns&amp;gt;
                    &amp;lt;/Intersoft:UXGridView&amp;gt;&lt;/pre&gt;
&lt;p&gt; Its itemsource property is set in source when it populates observable collection for the first time. This is thread progress changed event code which populates the observable collection.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;ArrayList arrlst = (ArrayList)e.UserState;
            for (int m = 0; m &amp;lt; arrlst.Count; m&amp;#43;&amp;#43;)
            {
                string[] rs = (String[])arrlst[m];
                MyData dt = new MyData();
                dt.keyword = rs[0];
                dt.sources = rs[1];
                GridDatafin.Add(dt);
            }&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I have tested with both QueryOperation="Client"  and QueryOperation="Server" &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Now all the data gets populated perfectly. Its just the filter.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Let me know thanks&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Mon, 17 Sep 2012 03:30:48 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The filter feature in UXGridView can be implemented both client and server data operation. When you set the QueryOperation to Client, UXGridView will process the data filtering operation in the client against the given data source.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;When QueryOperation is set to Server, UXGridView will not attempt to perform the data operation on the given data source. Instead it will store and distribute the query information to the one of QueryDescriptor property (in this case is the QueryDescriptor.FilterDescriptors property). When the collection changes, the QueryChanged event of the FilterDescriptor will be raised.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The live sample version of server side filtering is available in &lt;a href="http://live.clientui.com/#/UXGridView/Filtering"&gt;here&lt;/a&gt; and the client side filtering is available in &lt;a href="http://live.clientui.com/#/UXGridView/Filtering/ClientSideFiltering"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I’m willing to advise you further but in order to do so I would need you to elaborate on your specific scenario and possibly give me a step-by-step guide and a running simple sample that I can use to observe the reported problem.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Gridview filtering with ObservableCollection as itemsource</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Gridview-filtering-with-ObservableCollection-as-itemsource/</link><pubDate>Sun, 16 Sep 2012 07:11:01 GMT</pubDate><dc:creator>ismailiich@gmail.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I have a gridview (WPF desktop application) who's binding source is ObservableCollection of struct. I am trying to implement filtering on this gridview but it does not filter after applying a filter. &lt;/p&gt;</description></item></channel></rss>