From a performance point of view - what is the best way to refresh a grid on the display?
I have en app where the user can select different skins and the skinning of the datagrid is implemented on both grid and cell levels:
grid (for headers and gridlines):
GridStyle="{StaticResource gridColors}"
cell:
<syncfusion:GridTextColumn.CellStyle>
<Style TargetType="syncfusion:GridCell">
<Setter Property="Foreground"
Value="{Binding UserData[0].TextColor, Mode=OneWay}" />
<Setter Property="BackgroundColor"
Value="{Binding UserData[0].BackgroundColor, Mode=OneWay}" />
</Style>
</syncfusion:GridTextColumn.CellStyle>
All of this works exactly as I want it to, no problem. But when a user select a new skin, I need to initiate a refresh of the complete grid to apply the new skin, and the only way I have found to do this is through:
dataGrid.ItemsSource = null;
dataGrid.ItemsSource = data.Items;
This also do exactly what I want it to do,
but the performance is rather poor. Is there any better way to initiate a refresh of the grid style? (The content of the grid is unchanged, only the style is changed)