Declined
Last Updated: 14 Apr 2025 12:30 by ADMIN
Stenly
Created on: 11 Mar 2025 13:38
Category: GridView
Type: Bug Report
0
GridView: Placing a RadGridView inside a RadDocking that has its theme set to Windows 11 causes the cells to look merged after editing them

If a RadDocking has its theme set to Windows 11 via the StyleManager.Theme attached property, placing a RadGridView inside (styled with a different theme, such as Office_Black, Summer, etc.) will cause its cells to look merged after performing an edit operation.

As a workaround, the RowHeight and the FontSize properties of the RadGridView instance can be used to resolve this.

1 comment
ADMIN
Masha
Posted on: 14 Apr 2025 12:30

Hello,

The issue occurs because the StyleManager does not support applying different themes to different controls within the same visual tree. In this case, applying the Windows 11 theme to RadDocking while using a different theme for RadGridView leads to visual inconsistencies. As a workaround, you can use NoXaml binaries and apply the default theme globally in App.xaml and then locally merge the desired theme resources within the RadGridView's resources. For example:

<!-- App.xaml -->
<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/System.Windows.xaml"/>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.xaml"/>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Windows11;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>
    </ResourceDictionary.MergedDictionaries>                
</ResourceDictionary>

<!-- MainWindow.xaml -->
<telerik:RadDocking>
    <telerik:RadDocking.DocumentHost>
        <telerik:RadSplitContainer>
            <telerik:RadPaneGroup>
                <telerik:RadPane Header="Pane 1">
                    <telerik:RadPane.Content>
                        <telerik:RadGridView ItemsSource="{Binding Items}"
                                             GroupRenderMode="Flat" 
                                             NewRowPosition="Bottom"
                                             FontSize="12"
                                             AutoGenerateColumns="False">
                            <telerik:RadGridView.Resources>
                                <ResourceDictionary>
                                    <ResourceDictionary.MergedDictionaries>
                                        <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/System.Windows.xaml"/>
                                        <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.xaml"/>
                                        <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
                                        <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
                                    </ResourceDictionary.MergedDictionaries>
                                </ResourceDictionary>
                            </telerik:RadGridView.Resources>
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"/>
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                    </telerik:RadPane.Content>
                </telerik:RadPane>
            </telerik:RadPaneGroup>
        </telerik:RadSplitContainer>
    </telerik:RadDocking.DocumentHost>
</telerik:RadDocking>

However, we do not recommend mixing themes in this manner as it can lead to unexpected UI issues and inconsistent behavior.

Regards,
Masha
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!