I use RadGridView component, that I want to clean and reuse with different data in code behind (for example by clicking on button).
So what am I doing is calling a clear on all Columns (RadGridView.Columns.Clear()) and then I will start adding new columns for different data.
But the problem is when I use it with GridViewColumnGroup the clearing or adding new Columns takes an long time (seconds or minutes for test example where I have 500 Columns and 50 ColumnGroups).
Even if I add ColumnGroups before adding Columns, it will only slightly improve the situation.
This slow processing occurs only after component has been displayed at least once. If the component was not already loaded (shown) it takes almost no time.
I tried hidding component before this process, or unsetting ItemsSource, but nothing helped.
Thank you for any help.
I added image of Callstack, when i call Clear() method on Columns: