Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Re: 2 Filtering questions

  •  04-24-2008, 3:38 PM

    Re: 2 Filtering questions

    The auto-filter drop down will appear when distinct values are calculated for a data-grid item property. That said, you can set the DefaultCalculateDistinctValues property of the DataGridCollectionViewSource to false (by defaul true)  and explicitly set the CalculateDistinctValues property of each data-grid item property for which you want the auto-filtering to true.

    If you are using the DataGridCollectionView in code,  you will need to explicitly set the CalculateDistinctValues of the data-grid item properties for which you don't want auto-filtering to false.

    As for providing an inital filter:

    DataGridCollectionView view = new DataGridCollectionView( App.Orders.DefaultView );
    view.AutoFilterMode =
    AutoFilterMode.And;
    view.AutoFilterValues[
    "ShipCountry" ].Add( "Canada" );
    this.OrdersGrid.ItemsSource = view;

     


    Technical Writer - Xceed Software

    Of all the things I've lost, I miss my mind the most. - Mark Twain
    Filed under:
View Complete Thread
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.