locked
Multiple filters for one CollectionViewSource? RRS feed

  • Question

  • Hi!

    I want to apply multiple filters, from comboboxes, on a datagrid but how do you apply multiple filters? I'm binding my datagrid to a CollectionViewSource, but you can only bind to one filter function do you have to make you own logic for all filters in that filter callback function?

    Thanks!


    • Edited by Kavorka79 Wednesday, November 2, 2011 11:23 AM
    Wednesday, November 2, 2011 11:15 AM

Answers

  • Hi Kavorka,

    yes, there are properties like "SortDescriptions" and "GroupDescriptions", but there is no such thing as "FilterDescriptions".

    So if you want to apply multiple filters, you should create an object that keeps track of the current active filters, and use that object in the filter callback.

    • Marked as answer by Sheldon _Xiao Monday, November 14, 2011 1:35 PM
    Friday, November 4, 2011 10:16 AM

All replies

  • Hi Kavorka,

    yes, there are properties like "SortDescriptions" and "GroupDescriptions", but there is no such thing as "FilterDescriptions".

    So if you want to apply multiple filters, you should create an object that keeps track of the current active filters, and use that object in the filter callback.

    • Marked as answer by Sheldon _Xiao Monday, November 14, 2011 1:35 PM
    Friday, November 4, 2011 10:16 AM
  • Hi Kavorka79,

    I am marking your issue as "Answered", if you have new findings about your issue, please let me know.

     

    best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, November 14, 2011 1:35 PM