Reputation: 666
I have a RadGridView using telerik and the default color is black. I was wondering how do I change that color.
<telerik:RadGridView Name="dgData1"
ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Visible" VerticalAlignment="Bottom"
AutoGenerateColumns="False" Grid.Column="0"
ShowGroupPanel="False"
IsFilteringAllowed="False"
CanUserReorderColumns="False"
RowIndicatorVisibility ="Collapsed"
IsReadOnly="True"
EnableRowVirtualization="False"
EnableColumnVirtualization="False"
SelectionMode="Single"
Sorting="dgData_Sorting">
</telerik:RadGridView>
Upvotes: 1
Views: 3452
Reputation: 666
All you need to do is add "telerik:StyleManager.Theme="Summer"" to your data grid view.
<telerik:RadGridView Name="someName" telerik:StyleManager.Theme="Summer"
AutoGenerateColumns="False" Grid.Column="0"
ShowGroupPanel="False"
IsFilteringAllowed="False"
CanUserReorderColumns="False"
RowIndicatorVisibility ="Collapsed"
IsReadOnly="True"
EnableRowVirtualization="False"
EnableColumnVirtualization="False"
SelectionMode="Single"
</telerik:RadGridView>
Upvotes: 0
Reputation: 376
Try this code:
<telerik:RadGridView ItemsSource="{Binding}" Background="Red" Foreground="White" AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="24,36,0,0" Name="radGridView1" VerticalAlignment="Top">
<telerik:RadGridView.RowStyle>
<Style TargetType="{x:Type telerik:GridViewRow}">
<Setter Property="Background" Value="Red"/>
<Setter Property="Foreground" Value="White"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="DarkOrange"/>
<Setter Property="Foreground" Value="black"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="LightYellow"/>
<Setter Property="Foreground" Value="black"/>
</Trigger>
</Style.Triggers>
</Style>
</telerik:RadGridView.RowStyle>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="EmployeeID" DataMemberBinding="{Binding EmployeeID}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Hope this help you.
Upvotes: 2