Ticket Q296071
Visible to All Users

ASPxGridView - How to set the defaul AutoFilterCondition programmatically for all columns

created 14 years ago

I need to change the AutoFilterCondition default to "contains" for all the columns. I saw that there's an individual column settings but I wish to find a way to do that one time for all the column. I didn't find a global setting for that.
Can I do that programmatically? Eventually I want to do it only for a certain type of columns (Text mostly).
Thanks
Regards

Comments (3)
DevExpress Support Team 14 years ago

    Hello Alberto,
    Thank you for your question. You might need to set GridViewDataColumnSettings.AutoFilterCondition for each grid column since there is no capability to define the comparison operator type for all the columns at once.
    Also, you can try the following code:

    Visual Basic
    Protected Sub Page_Load(sender As Object, e As EventArgs) For Each col As GridViewDataColumn In grid.Columns col.Settings.AutoFilterCondition = AutoFilterCondition.Contains Next End Sub

    Thanks,
    Marion

      Thanks Marion,
      that accomplished the task, but would be good to have a global option for that. Do you think there is room for a suggestion about that?

      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.