I have recently implemented themes in my application. The application has two themes, Day & Night. The application changes themes by loading a ResourceDictionary that defines different colors for the same named SolidColorBrush DynamicResources.
Here is the xaml for the style I'm using for the rows in the all of the RadGridView controls in my application. This is in the app,xaml file:
I think the first row is probably the row used to insert new rows into the Grid. Here's the XAML for one of my RadGridControls:
As you can see, the control is read-only and it doesn't allow inserting, editing or deleting of rows.
In the Day theme, the rows in my RadGridView have black text on white backgrounds. In the Day theme, they're supposed to have yellow text on black backgrounds. And every row in the DataGridControl matches this color scheme exept the first, which still has a white background.
How do I get the first row's background to change with the other rows?
Tony
Here is the xaml for the style I'm using for the rows in the all of the RadGridView controls in my application. This is in the app,xaml file:
<
Style
TargetType
=
"telerik:GridViewRow"
>
<
Setter
Property
=
"Background"
Value
=
"{DynamicResource TextBackground}"
/>
<
Setter
Property
=
"Foreground"
Value
=
"{DynamicResource TextForeground}"
/>
</
Style
>
I think the first row is probably the row used to insert new rows into the Grid. Here's the XAML for one of my RadGridControls:
<
telerik:RadGridView
AutoExpandGroups
=
"True"
AutoGenerateColumns
=
"False"
Background
=
"{DynamicResource DataBackground}"
CanUserDeleteRows
=
"False"
CanUserFreezeColumns
=
"False"
CanUserInsertRows
=
"False"
CanUserResizeColumns
=
"False"
CanUserSortColumns
=
"True"
EnableColumnVirtualization
=
"True"
EnableRowVirtualization
=
"True"
FontSize
=
"16"
FontWeight
=
"Bold"
Foreground
=
"{DynamicResource DataForeground}"
Grid.Column
=
"1"
Grid.ColumnSpan
=
"2"
Grid.Row
=
"1"
IsReadOnly
=
"True"
ItemsSource
=
"{Binding Path=DataRetentionPolicies, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type cs:AdvancedSettingEditor}}}"
Margin
=
"5"
Name
=
"DataPolicies"
SelectionUnit
=
"FullRow"
ScrollMode
=
"Deferred"
ScrollViewer.CanContentScroll
=
"True"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
ShowGroupFooters
=
"True"
TabIndex
=
"8"
ToolTip
=
"Data Maintenance Properties"
Visibility
=
"{Binding Converter={StaticResource BoolToVisibility}, Mode=TwoWay, Path=EnableRetention, RelativeSource={RelativeSource AncestorType={x:Type cs:AdvancedSettingEditor}}}"
>
<
telerik:RadGridView.Columns
>
. . .
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
As you can see, the control is read-only and it doesn't allow inserting, editing or deleting of rows.
In the Day theme, the rows in my RadGridView have black text on white backgrounds. In the Day theme, they're supposed to have yellow text on black backgrounds. And every row in the DataGridControl matches this color scheme exept the first, which still has a white background.
How do I get the first row's background to change with the other rows?
Tony