Ticket T261811
Visible to All Users

Columns are hidden/added slowly even when the Columns.BeginUpdate and Columns.EndUpdate methods are used

created 10 years ago

Just to introduce you into my problem, I've got tableview with 600 columns and 600 rows. I need to filter this table with some condition which is similar for both columns and rows. There is no problem to filter out some rows using CustomRowFilter, but I need to hide columns as well. I didn't find any built-in functionality to accomplish this task so I tried to do it manually by setting column's Visible property. Problem is that every single call of

C#
gridColumn.Visible = trueOrFalseParam;

takes about 30 milliseconds. So hiding of 300 columns takes up to 9 seconds which is very slow. I tried to surround it by gcDetail.Columns.BeginUpdate();and gcDetail.Columns.EndUpdate();but no change. Please can you suggest me any solution how to speed things up in my scenario? Is there any built-in feature how to conditionally hide columns?

Comments (3)
Alexander Russkov (DevExpress) 10 years ago

    Hi Martin,
    We optimized the process of showing/hiding columns in version 14.1. I have attached a video to demonstrate that now it doesn't take much time to hide a large set of columns when the BeginUpdate and EndUpdate methods are used. Would you please clarify if it is possible for you to upgrade to a newer version?

    Thanks,
    Alexander

      Thank you for your answer. Unfortunately, I'm stuck with 13.2.11 for a while so I will try to test it with trial subscription and hope that we will upgrade soon. I suppose there is no chance to speed it up in older version?

        Sorry, 13.2.13

        Answers approved by DevExpress Support

        created 10 years ago (modified 10 years ago)

        Hi Martin,
        To optimize the process of hiding multiple columns in version 13.2, implement the IColumnOwnerBase.CalcColumnsLayout method in a TableView descendant. I have attached a sample project to demonstrate how to accomplish this task.

        Thanks,
        Alexander

          Comments (2)

            Thank you very much, Alexander! With suggested optimization, it takes me 80 ms to hide 600 columns. Great improvement. Thank you again for your help.

            Alexander Russkov (DevExpress) 10 years ago

              It's my pleasure, Martin! I am always happy to help.

              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.