Infragistics4.Win.UltraWinGrid.v17.2, Version=17.2.20172.2006
I have a grid with relatively big number of rows.
It takes time to format all the rows and that causes UI delays. I tried to format visible rows only but I have not found a way to make this approach work in case if sorting or filtering is applied to the grid.
Any suggestions would be greatly appreciated
Hello Alexander,
My team and I have done an initial review of your requirements in this case, and a recommendation for the “best practices” for formatting the rows of the UltraGrid is really subjective and dependent to the formatting that you are trying to apply.
With that said, if you are trying to apply a consistent formatting to each cell of a particular column, I would recommend setting this on the column itself as a best practice.
Would it be possible for you to please provide some additional information on the actions that you are taking on the UltraGrid so that perhaps I can reproduce the UI delays you are seeing?
It is also worth noting that version 17.2 is not a supported version at the time of writing this, and it is possible that you may see performance improvements simply by upgrading to a more recent version.
Please let me know if you have any other questions or concerns on this matter.
Andrew Goldenbaum said:It is also worth noting that version 17.2 is not a supported version
We use a third party library which in turn depends on the 17.2. I hope we'll be able to upgrade it in a month or so, but as for now the 17.2 is the only option, unfortunately.
Andrew Goldenbaum said:With that said, if you are trying to apply a consistent formatting to each cell of a particular column, I would recommend setting this on the column itself as a best practice.
That's not possible in our case as each row contains dependent cells that needs to be formatted depending on each other. So the same column can be formatted in different ways for different rows. For instance, one column contains a drop-box with unit of measure options and another column should contain a properly formatted (depending on the chosen unit of measure) value.
Andrew Goldenbaum said:Would it be possible for you to please provide some additional information on the actions that you are taking on the UltraGrid so that perhaps I can reproduce the UI delays you are seeing?
I did some profiling and it shows that setting an editor for a cell is a very time consuming operation. I tried code like as follows:
var editor = new UltraNumericEditor { NumericType = NumericType.Decimal };
cell.EditorComponent = editor; // <-- this line takes relatively much time to execute
I believe that personally, I would utilize the InitializeRow for this type of formatting, as this will allow you to catch each row as it initializes and then format its cells accordingly. I am unsure if this would really be the best route if you have a very large amount, of rows in this case, though, as InitializeRow will fire for every row on startup.
An alternative in this case could be to wait for the grid to actually load and then do the formatting for the currently visible rows, like you had mentioned in another forum discussion that we have together about doing this after sorting and filtering. For reference, here (https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/124992/ultragrid-sort-order-is-changed-and-filter-is-applied-events). The potential issue with this though, is that you may end up doing the formatting for rows that have already been formatted if you don’t do some extra caching or something of the like that you can check for.