Ticket Q486879
Visible to All Users

ASPxGridView - How to set the default column filter conditions to "Contains"

created 12 years ago

Hi there…

Have been working with the ASPxGridview, and its autofilter feature, but…

I would like to have the filter being applied to use the Like search feature as standard.

Yes, can get it show in the the search-menu options, but each time the user enters the page, its reverted back to that the entered text has to what it starts with - where as I want it to use the Like function instead.

Have been looking arround, but can ́t find a way to set this in the filter-functions (?)

Then I tried to catch the filter being entered through the AutoFilterCellEditorCreate event - and this worked, but how do I get hold of what the user has entered (text) in the autofilter box ? My idea was to apply the filter manually with what the user entered through the FilterActiveString…

Hope you get an idea of what I am trying to do - but haven ́t succeded in this yet, as I can ́t get the entered values, and that way build the filter through code/callback

Regards

Michael

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hello Michael,
Set the column's Settings.AutoFilterCondition property to "Contains" to set the default column's filter conditions to "Contains". Attached is a sample project. Please let me know if you need further assistance.

    Comments (3)
    MH MH
    Michael Hornshøj 12 years ago

      Yes… I just knew it was there somewhere - but where do you have that setting ?
      In the grids settings, or… ?? (or can ́t it be accessed through the Properties ?)
      Regards
      Michael

      DevExpress Support Team 12 years ago

        Hi,
        You can access this property under GridViewColumn.Settings.AutoFilterCondition as follows:
        Design Time:

        ASPx
        <dx:GridViewDataTextColumn FieldName="CategoryName" VisibleIndex="2"> <Settings AutoFilterCondition="Contains"></Settings> </dx:GridViewDataTextColumn>

        Code Behind:

        C#
        column.Settings.AutoFilterCondition

        See the attached video.

        MH MH
        Michael Hornshøj 12 years ago

          Vupti ;-)
          Found it - was looking under the GridView, as I figured it was a global setting for the entire grid, but logic says it has to be under the columns, and settings can be customized for each column ;-)
          Thanks for you assistance - as always, the trick is to know where to look ;-)
          Great - and thanks again ;-) ;-)
          Regards
          Michael

          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.