Ticket T262755
Visible to All Users

How to filter collection properties

created 10 years ago

[DevExpress Support Team: CLONED FROM T187964: 14.2 Token column in DatGrid]
and actually going forward, I dont know how to implement filtering on such column
I tried approach proposed in https://www.devexpress.com/Support/Center/Question/Details/T100910
but dont know how to write a criteria in this implementation
EditValue = CriteriaOperator.Parse(string.Format(@"Contains([MyStringCollectionUnbound], '{0}')", s))
indeed even trying to filter in the standard filter I could not get it properly filtering - the result is empty list (please see the attachment)
Thanks for helping,
Victor

Comments (3)
DevExpress Support Team 10 years ago

    Hi Victor,
    Please clarify how you wish to filter the column. As far as I can see, each cell in the column is a collection of tokens. Do you wish to display all unique tokens from all the cells within the filter dropdown and choose ones in order to build criteria that will return the collections containing all these tokens? If so, please review the attached sample from Andrey's last comment in How to implement custom filtering in GridColumn with data of List type.

    If your scenario is different, please describe it in greater detail. I am looking forward to your reply.

      hi Ilya
      yes I wanted to provide tokens as a List of strings and then filter by the value chosen
      as example I used
      https://www.devexpress.com/Support/Center/Question/Details/T100910
      it all worked ok except the fact that it didnt filter properly and the part which didnt work was a criteria
      Criteria is the same as if one wrote it in a normal filter editor - see the example in the attached image
      if I am trying to filter there it doesnt work with any condition
      so when I tried to write a condition as in the example it doesnt work for the same reason
      Regards,
      Victor

        I attached the project to illustrate the issue
        could you modify the way condition should be written there?
        thanks,
        Victor

        Answers approved by DevExpress Support

        created 10 years ago (modified 10 years ago)

        Hi Victor,

        In your specific scenario (ComboBoxEdit is bound to a collection of objects), this functionality can be implemented using the following approach:

        1. Set the ColumnFilterMode property to "DisplayText".
        2. Handle the CustomColumnDisplayText event and set e.DisplayText to a string that will contain values of all items from the cell.
          I have attached a sample demonstrating my approach. Please take a moment to review it.
          Show previous comments (18)

            thanks Elliot
            I migrated our client to the solution above and would be really looking forward to get the fix (as I can not deliver the next version without it).
            Do you know when this bug is expected to  be fixed?
            Kind regards,
            Victor

            DevExpress Support Team 10 years ago

              Hello Victor,

              Thank you for your clarification. I cannot provide you with any estimate as to when this issue will be resolved, since it depends on various factors. You will receive an e-mail message when the status of ComboBoxEdit in a GridControl column raises an exception after upgrade to 15.1.4 ticket  is changed.

              Thanks,
              Elliot

                thanks Elliot

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.