We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Use dynamic values for colors on DataGrid Theme

Hi guys. I'm currently using a custom theme for my data grid on the app's resources, based on the documentation.

<x:String x:Key="SfDataGridTheme">CustomTheme</x:String> 
                <Color x:Key="SfDataGridHeaderBackgroundColor">White</Color> 
                <Color x:Key="SfDataGridHeaderForegroundColor">White</Color> 
                <Color x:Key="SfDataGridRecordBackgroundColor">#127ac7</Color> 
                <Color x:Key="SfDataGridRecordForegroundColor">White</Color>
                <Color x:Key="SfDataGridAlternatingRowBackgroundColor">#38a0ed</Color>

This theme works as expected. However, I implemented a Theme selector on my app and now I can use 3 different colors for the controls. Each color is assigned by a resource file

<Style TargetType="NavigationPage">
     <Setter Property="BarBackgroundColor" Value="{DynamicResource NavigationBarColor}"/>
     <Setter Property="BarTextColor" Value="{DynamicResource PrimaryTintColor}"/>

Can you please help me set the properties of the DataGridTheme, similarly to the NavigationPage Style? I can't find any document related to this issue.

Thanks in advance.


2 Replies

SK Shivagurunathan Kamalakannan Syncfusion Team August 27, 2019 09:20 AM

Hi Andres, 
We have checked your code snippet. Currently we are checking the feasibility to set the style for DataGridTheme properties. We will analyze and update you further details on or before 29th August 2019. 
We appreciate your patience until then. 

SK Shivagurunathan Kamalakannan Syncfusion Team August 28, 2019 08:58 AM

Hi Andres, 
Thank you for your patience. 
We have analyzed your query. As of now we don’t have the “Support to set the style properties in XAML”. We have considered to provide this support and logged feature request for the same. We will implement this feature in any of our upcoming release.  
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then.    
You can also communicate with us regarding the open features any time using our Feature Report page.     
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal.   
Also, you can apply styling by extending from DataGridStyle class. Please refer the following user guideline for more details. 

Live Chat Icon For mobile
Up arrow icon