Hello SO community :o)
First of all, I am sorry for my english, I know this is not perfect, but I break my back to improve it. :)
I am currently working with the telerik Framework in WPF.
Here is the code (I had to change my variables name)
<telerik:RadGridView Name="GridName" IsPropertyChangedAggregationEnabled="True" EnableColumnGroupsVirtualization="True" EnableColumnVirtualization="True" ItemsSource="{Binding PagedSource, ElementName=PagerName}" AutoGenerateColumns="False" IsBusy="{Binding IsLoading}" SelectedItem="{Binding SelectedIsinFromGrid}" Grid.Row="0">
<telerik:RadGridView.Resources>
<Style TargetType="{x:Type telerik:GridViewRow}" BasedOn="{StaticResource {x:Type telerik:GridViewRow}}" >
<Style.Triggers>
<DataTrigger Binding="{Binding Status}" Value="ACTIVE">
<Setter Property="Background" Value="{StaticResource GreenRessourceColor}" />
</DataTrigger>
<DataTrigger Binding="{Binding Status}" Value="DISABLE">
<Setter Property="Background" Value="{StaticResource RedRessourceColor}" />
</DataTrigger>
<DataTrigger Binding="{Binding Status}" Value="UNKNOW">
<Setter Property="Background" Value="{StaticResource YellowRessourceColor}" />
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadGridView.Resources>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Header1" DataMemberBinding="{Binding Item1}" />
<telerik:GridViewDataColumn Header="Header2" DataMemberBinding="{Binding Item2}"/>
<telerik:GridViewDataColumn Header="Header3" DataMemberBinding="{Binding Item3}"/>
<telerik:GridViewDataColumn Header="Header4" DataMemberBinding="{Binding Status}"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadDataPager Name="PagerName" Style="{StaticResource CustomDataPagerStyle}" Grid.Row="1" Source="{Binding ItemsListToDisplay}" PageSize="100" IsTotalItemCountFixed="False" />
The error:
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Telerik.Windows.Controls.GridView.GridViewRow', AncestorLevel='1''. BindingExpression:Path=IsPinned; DataItem=null; target element is 'GridViewPinButton' (Name=''); target property is 'IsPinned' (type 'Boolean')
The grid, the pager and the datas are well displayed with the right color, excepte that I have this error inside my VS output.
More information about the usage of this code.
This code is used inside a UserControl, this userControl is wrapped inside a RadPane then it is injected into a RadPaneGroup.
Why am I doing this? Because I am using prism to inject my modules on the fly into the mainRegion as a RadPane
The error occure only when I am moving the pane outside the RadPaneGroup
It is like I messed up with the RadGridView styleRow.
As you can see, I am not using directly the IsPinned property.
Any Idea?