RadGridView Filtering

2 posts, 0 answers
  1. Kate
    Kate avatar
    2 posts
    Member since:
    Sep 2013

    Posted 15 Sep 2013 Link to this post

    Hello, I have problem with radgridview.
    Im using mvvm pattern. In viewmodel i implemented observablecollection which contain rows with data. : 
    xaml:
            <telerik:RadGridView ItemsSource="{Binding MyCollection}"
                                 x:Name="RadGridViewElement"
                                 FilteringMode="Popup"/>

    viewmodel:

     private ObservableCollection<myrow> myCollection = new ObservableCollection<myrow>();

            public kolekcja()
            {

                generatedata();
            }
            
            private void generatedata()
            {
               myrow row = new myrow();
                row.Imie = "aa";
                row.Nazwisko = "bb";
                myCollection.Add(row);
                myrow row1 = new wiersz();
                row1.Imie = "cc ";
                row1.Nazwisko = "dd";
                myCollection.Add(row1);
            }

            public ObservableCollection<wiersz> MyCollection
            {
                get { return myCollection; }
                set { myCollection = value; }
            }

    Is there any option to return filtered  radgridview data rows  (update myCollection ? or save rows to other collection ?) I would like create graph with the filtered data . I looking for the easiest way to create column header filter from GUI (Just like [DisplayAttribute( AutoGenerateField = false )] ) 
    any idea ?
    kind regards

     
  2. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 16 Sep 2013 Link to this post

    Hello,

    The RadGridView.Items property always contains the current view, which is the original collection after sorting, filtering and grouping. You can enumerate this property and you will get items that the user sees in RadGridView.

    DisplayAttribute.Name is what you are looking for to change the column headers.

    Regards,
    Rossen Hristov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top