Hi,
I have inherited RadGridView control with applied row style:
<telerik:RadGridView
xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
x:Class="DCMS.FrontEnd.SL.CustomControls.RadGrid" ...>
FontFamily="Arial Unicode MS"
Style="{StaticResource ListScreenGridViewData}"
RowStyle="{StaticResource ListScreenGridViewRow2}"
HeaderRowStyle="{StaticResource GridViewHeaderRowStyle}"
AutoGenerateColumns="False"
SelectionMode="Extended"
Sorting="gvData_Sorting" ShowGroupPanel="False"
SelectionChanged="gvData_SelectionChanged"
CellValidating="gvData_CellValidating"
CellEditEnded="gvData_CellEditEnded"> ...</telerik:RadGridView>
------------------------------ The following style is in the merged dictionary ----------------------------------
<Style x:Key="ListScreenGridViewRow2" TargetType="gridNamespace:GridViewRow">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="MinHeight" Value="24"/>
<Setter Property="FontSize" Value="11"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Foreground" Value="#FF000000"/>
</Style>
Working this way the row style is applied correctly. But when I put this control in the UserControl:
<UserControl
xmlns:custom="clr-namespace:DCMS.FrontEnd.SL.CustomControls"
x:Class=".DCMS.FrontEnd.SL.CustomControls.Grid" ...>
<StackPanel x:Name="spData"
Orientation="Vertical" SizeChanged="spData_SizeChanged">
<custom:RadGrid
Style="{StaticResource ListScreenGridViewData}"
RowStyle="{StaticResource ListScreenGridViewRow2}"
HeaderRowStyle="{StaticResource GridViewHeaderRowStyle}"
Grid.Column="0"
Grid.Row="0"
x:Name="gvData"
FontFamily="Arial Unicode MS"
AutoGenerateColumns="False"
Sorting="gvData_Sorting"
ShowGroupPanel="False"
SelectionChanged="gvData_SelectionChanged" />
...
</UserControl>
I can't make the inherited RadGridView in user control to use referenced RowStyle when I use it in UserControl.
Can you please point out the mistake I'm making, if you see something that I don't?