DataGridBorderStyle properties are not support Binding

1 Answer 20 Views
DataGrid
Arkady
Top achievements
Rank 1
Iron
Arkady asked on 27 Jun 2022, 02:06 AM

Hi, today found i cannot use theming (Light and Dark) for DataGrid, because DataGridBorderStyle class not support binding for the BackgroundColor, BorderColor and TextColor

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 28 Jun 2022, 10:59 AM

Hello Arkady,

I have logged a feature request on your behalf regarding the unsupported binding for the mentioned properties. You can follow the feature request here -> https://feedback.telerik.com/maui/1570690-datagrid-provide-support-for-property-binding-in-datagridborderstyle-class. By following the item on our public feedback portal you will be notified when its status gets updated. In the meantime I can suggest 2 separate DataGridBorderStyles (one for the light theme and one for the dark).

I'm providing you with an example of the 2 DataGridBorderStyles.

Resources:

<ContentPage.Resources>
    <telerik:DataGridBorderStyle x:Key="lightDataGridStyle" 
                                    BackgroundColor="Blue"
                                    BorderThickness="1"
                                    BorderColor="Black" />

    <telerik:DataGridBorderStyle x:Key="darkDataGridStyle" 
                                    BackgroundColor="Red"
                                    BorderThickness="1"
                                    BorderColor="White" />
</ContentPage.Resources>

The DataGrid:

<telerik:RadDataGrid x:Name="dataGrid" ItemsSource="{Binding People}" AutoGenerateColumns="False">
    <telerik:RadDataGrid.Columns>
        <telerik:DataGridTextColumn PropertyName="Name" 
                                    CellDecorationStyle="{AppThemeBinding Light={StaticResource lightDataGridStyle},
                                                                                                Dark={StaticResource darkDataGridStyle}}"/>
        <telerik:DataGridNumericalColumn PropertyName="Age"/>
    </telerik:RadDataGrid.Columns>
</telerik:RadDataGrid>

If you have any further questions, please let us know.

Regards, Deyan Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
DataGrid
Asked by
Arkady
Top achievements
Rank 1
Iron
Answers by
Deyan
Telerik team
Share this question
or