Current filter:
                                You should refresh the page.
                                  • I attached sample project to demonstrate issue.
                                    Loading of 200 columns taking more time. Similarly Bestfit also taking more time.

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Rajesh,

                                Let me address these issues sequentially.

                                1. It takes a lot of time to load 200 columns.

                                I've researched your application using a performance profiling tool and see that the issue occurs because GridControl updates its structure 200 times when you add items to the ViewModel.Columns collection. Although you invoke a single extension method (i.e., AddRange), this methods adds all items sequentially, and the Columns collection raises a notification after each modification.

                                Since you use our ObservableCollectionCore<T>, you can invoke the BeginUpdate/EndUpdate methods for it to temporarily disable notifications:

                                [C#]
                                //ViewModel.Columns.AddRange(columns); ViewModel.Columns.BeginUpdate(); foreach (var c in columns) ViewModel.Columns.Add(c); ViewModel.Columns.EndUpdate();

                                This significantly reduces the delay on my side.

                                2. It takes more time to calculate grid columns' width

                                The delay is larger because the grid must calculate the width for all 200 columns at once. As I mentioned in the T759440 ticket, the delay will always be larger if you have more columns.

                                As a possible alternative, you can invoke BestFitColumn only for certain columns in your grid.

                                Thanks

                                • Rajesh Aravapalli 07.25.2019

                                  Can I use custom logic to set width based on header text length?  Like below?
                                  https://stackoverflow.com/questions/9264398/how-to-calculate-wpf-textblock-width-for-its-known-font-size-and-characters

                                  We need to add lot of controls to implement crrazy requirements. So calculating size may take time. All we need is for to header length.

                                • Ivan (DevExpress Support) 07.26.2019

                                  Yes, you can try a similar logic instead of the BestFitColumns method. However, as grid headers may display different elements (sort indicators, custom content defined in HeaderTemplate, etc.), and control settings may be different from theme to theme, there is no universal solution here. You will need to implement this logic on your side and carefully test it for your grid controls.

                                • Rajesh Aravapalli 07.26.2019

                                   office 2016 white theme fixed.
                                  Other customisations need extra 21px. Just I need size of header.

                                • Ivan (DevExpress Support) 07.29.2019

                                  Thank you for sharing your results. Please let me know if you have additional questions or concerns.