I am looking for new ways to improve the load performance of the RadGridView control.
I already had a look at the tips from your site, and have followed many of them while others do not apply as we have some special requirements which I could not achieve using your default styles.
I found that reducing the number of FrameworkElements in the Grid greatly improves the loading performance. Using Snoop, I found that we had nearly 20000(!) FrameworkElements on a full-page GridView (with row-virtualization enabled, as we found that column-virtualization severely reduced the horizontal scrolling performance). After doing some optimizations, I was able to reduce the number of elements to now 5200, reducing the loading time from more than 5 seconds to 1.5 seconds (on a fast development PC - it could still be much slower on a user PC).
One big impact factor is the GridViewCell template. If you have a look at the template (in our case the VisualStudio2013 version), it has 174 lines of code and ~12 FrameworkElements! By creating my own template (specifically for WPF, using triggers), I was able to reduce it to 32 lines of code and 2 FrameworkElements (1 border for cell separation + 1 ContentPresenter), maintaining the same look as before (maybe not every single behavior is reproduced, but the ones that we use). This single optimization leads to a reduction of loading time by ~1.4 seconds!
Now I would like to further reduce the number of elements. One Idea was to merge the GridViewCell with the border and the ContentPresenter - having 1 element instead of 3. The next step would be to implement some kind of "cell renderer" to draw simple cell templates (like the TextBlock) in the OnRender event, saving one (or more) further elements per cell. To achieve this, I have to derive from GridViewCell(Base).
However, there is one problem: While the CreateItem method in the RadGridView is protected (so I could create a derived GridViewRow), the CreateItem method in the GridViewRow is internal, effectively stopping me from creating my own implementation of GridViewCell. I am wondering why it was decided to do it this way? I see that you are accessing the method from outside the row, so protected would not be an option. But what about "protected internal"? Changing it to this should not break an usage - but allows to greatly improve usability of the class.
Alex
I already had a look at the tips from your site, and have followed many of them while others do not apply as we have some special requirements which I could not achieve using your default styles.
I found that reducing the number of FrameworkElements in the Grid greatly improves the loading performance. Using Snoop, I found that we had nearly 20000(!) FrameworkElements on a full-page GridView (with row-virtualization enabled, as we found that column-virtualization severely reduced the horizontal scrolling performance). After doing some optimizations, I was able to reduce the number of elements to now 5200, reducing the loading time from more than 5 seconds to 1.5 seconds (on a fast development PC - it could still be much slower on a user PC).
One big impact factor is the GridViewCell template. If you have a look at the template (in our case the VisualStudio2013 version), it has 174 lines of code and ~12 FrameworkElements! By creating my own template (specifically for WPF, using triggers), I was able to reduce it to 32 lines of code and 2 FrameworkElements (1 border for cell separation + 1 ContentPresenter), maintaining the same look as before (maybe not every single behavior is reproduced, but the ones that we use). This single optimization leads to a reduction of loading time by ~1.4 seconds!
Now I would like to further reduce the number of elements. One Idea was to merge the GridViewCell with the border and the ContentPresenter - having 1 element instead of 3. The next step would be to implement some kind of "cell renderer" to draw simple cell templates (like the TextBlock) in the OnRender event, saving one (or more) further elements per cell. To achieve this, I have to derive from GridViewCell(Base).
However, there is one problem: While the CreateItem method in the RadGridView is protected (so I could create a derived GridViewRow), the CreateItem method in the GridViewRow is internal, effectively stopping me from creating my own implementation of GridViewCell. I am wondering why it was decided to do it this way? I see that you are accessing the method from outside the row, so protected would not be an option. But what about "protected internal"? Changing it to this should not break an usage - but allows to greatly improve usability of the class.
Alex