Grid header styles common for themes

1 Answer 291 Views
DataGrid Styling
Chiran
Top achievements
Rank 1
Iron
Iron
Chiran asked on 21 Sep 2021, 04:52 AM | edited on 21 Sep 2021, 08:26 AM

How to common the grid header styles (Dark & light), by repeating each column header for light & dark theme it'll increase the number of code, need to common all headers styles.

please give me a solution...

Thanks...

<telerikDataGrid:DataGridTextColumn.HeaderStyle>
    <AppThemeBinding>
        <AppThemeBinding.Light>
            <telerikDataGrid:DataGridColumnHeaderStyle 
                    BackgroundColor="#ffffff"
                    BorderColor="#F0EFF3"
                    BorderThickness="1"/>
        </AppThemeBinding.Light>
        <AppThemeBinding.Dark>
            <telerikDataGrid:DataGridColumnHeaderStyle 
                    BackgroundColor="#2a3137"
                    BorderColor="#505d68"
                    BorderThickness="1"/>
        </AppThemeBinding.Dark>
    </AppThemeBinding>
</telerikDataGrid:DataGridTextColumn.HeaderStyle>

 

Chiran
Top achievements
Rank 1
Iron
Iron
commented on 22 Sep 2021, 03:47 AM | edited

this has two grid column headers, but both headers styles are the same for dark & light themes, need to use these dark & light themes in a common way,  need a solution for this...

Thanks

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 22 Sep 2021, 12:57 PM

Hi,

The approach for setting dark and light themes to DataGrid header style is the one you have found. 

Here is an example in our Telerik UI for Xamarin Sample application https://github.com/telerik/telerik-xamarin-forms-samples/blob/master/QSF/QSF/Examples/DataGridControl/CustomizationExample/CustomizationView.xaml#L139 

I am afraid I cannot suggest a different scenario to achieve this.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Chiran
Top achievements
Rank 1
Iron
Iron
commented on 24 Sep 2021, 05:43 AM

Thanks for your answer, but this is not a solution I'm looking for, it's simply centralized header styles belongs to light & dark styles
Tags
DataGrid Styling
Asked by
Chiran
Top achievements
Rank 1
Iron
Iron
Answers by
Didi
Telerik team
Share this question
or