Welcome to the Xceed Community | Help
Community Search  
More Search Options

Excluding some specific Row(s) from automatic filtering.

Sort Posts: Previous Next
  •  09-22-2009, 4:58 AM Post no. 24068

    Excluding some specific Row(s) from automatic filtering.

    Hi Support,

    I am new to Xceed DataGridControl, however I am too much fascinated with the UI and features of this control.

    I am using “ObservableCollection --> DataGridCollectionView --> DataGridControl” squad. I have a requirement where the grid should filter the records according to filter criterion selected by user. It is really cool to see the Excel like filtering in the XceedGrid using:

    myDataGridCollectionView.AutoFilterMode = AutoFilterMode.And;

    However at the same time I need to exclude some records from being filtered out, that is, they are required to be present all the time irrespective of the filters applied by user.

    Is there any direct or indirect way to achieve this? If required for this particular problem, I can even group the records within two groups, i.e. filterable /non-filterable.

    Waiting for the words of supportSmile
  •  09-22-2009, 2:16 PM Post no. 24088 in reply to 24068

    Re: Excluding some specific Row(s) from automatic filtering.

    What I could suggest is to use custom distinct values and to "exclude" the distinct values for the items that you never want to filter. For example, if you have 3 items that contain "apple, orange, and banana" and you want to never exclude "apple", what you could do is handle the QueryDistinctValue event of the appropriate DataGridItemProperty and only return "apple" and "orange".

    Hope that makes sense!


    Senior Technical Writer
    - Xceed Software

    In three words I can sum up everything I've learned about life: it goes on.
  •  09-23-2009, 7:20 AM Post no. 24100 in reply to 24088

    Re: Excluding some specific Row(s) from automatic filtering.

    Hi Jenny,

    Thanks for your prompt response. I feel this suggestion can make my task easier. Just to make my question more clear, here is an example:

    Lets say we have a table with column Fruit Name and Color. This table has 3 records [Apple,<blank>],[Orange,<blank>] and [Banana,Yellow].

    Now as per normal filter what ever I select in name or color the corresponding will be selected. But my requirement is what ever u select in filter checklist, the application will show you Apple as well. 

    The solution looks good for the case when I am applying filter on column Fruit Name however I am not sure how to handle  the condition where user selects the color as yellow. Surely in this case banana will be selected (being yellow) and I also want Apple to be there but not Orange (value of color for Apple and Orange is same <Blank>).

    I mean to say something like, whatever column user may filter upon, the record with Fruit Name (a specific column) as "Apple" (a specific value) should never be filtered out. If possible just remove its values from all the filter check-list as after all this record will be selected irrespective of filter criteria.

    Something like select all the records as per applied filters (all filters with "And" condition) + my particular record (an "Or"ed condition with the filter rules).

    A short sample would be of great help here.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.