I'm seeing an odd error with the grouping in the RadGridView. It's worth pointing out that the data is being displayed and grouped properly despite the error. However, I still want it resolved.
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Columns[ContactType]; DataItem=null; target element is 'ColumnGroupDescriptor' (HashCode=34214014); target property is 'Column' (type 'GridViewColumn')
Below is the relevant portion of my XAML. The extra columns have been elided as is the rest of the visual tree. I get the same problem if it's in different parts of the visual tree and even with just the one column.
<telerik:RadGridView x:Name="ContactsGridView"
ItemsSource="{Binding Employee.Contacts}">
<telerik:RadGridView.Columns>
<telerik:GridViewComboBoxColumn Header="Type" UniqueName="TypeColumn"
ItemsSource="{Binding ContactTypesView}"
DataMemberBinding="{Binding ContactTypeId}"
SelectedValueMemberPath="Id" DisplayMemberPath="TypeName"
EditTriggers="CellClick" ShowColumnWhenGrouped="False" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.GroupDescriptors>
<telerik:ColumnGroupDescriptor Column="{Binding Columns[\TypeColumn\], ElementName=ContactsGridView}"
SortDirection="Ascending" />
</telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>
I have a style that governs the several grids in my window. Here is that XAML:
<Style TargetType="{x:Type telerik:RadGridView}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="GridLinesVisibility" Value="None" />
<Setter Property="ShowGroupPanel" Value="False" />
<Setter Property="RowIndicatorVisibility" Value="Collapsed" />
<Setter Property="RowDetailsVisibilityMode" Value="Collapsed" />
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="CanUserFreezeColumns" Value="False" />
<Setter Property="SelectionUnit" Value="FullRow" />
<Setter Property="AutoExpandGroups" Value="True" />
<Setter Property="GroupRenderMode" Value="Flat" />
</Style>
Any ideas of what might be causing this error? I created a stripped down solution and couldn't duplicate the error message.
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Columns[ContactType]; DataItem=null; target element is 'ColumnGroupDescriptor' (HashCode=34214014); target property is 'Column' (type 'GridViewColumn')
Below is the relevant portion of my XAML. The extra columns have been elided as is the rest of the visual tree. I get the same problem if it's in different parts of the visual tree and even with just the one column.
<telerik:RadGridView x:Name="ContactsGridView"
ItemsSource="{Binding Employee.Contacts}">
<telerik:RadGridView.Columns>
<telerik:GridViewComboBoxColumn Header="Type" UniqueName="TypeColumn"
ItemsSource="{Binding ContactTypesView}"
DataMemberBinding="{Binding ContactTypeId}"
SelectedValueMemberPath="Id" DisplayMemberPath="TypeName"
EditTriggers="CellClick" ShowColumnWhenGrouped="False" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.GroupDescriptors>
<telerik:ColumnGroupDescriptor Column="{Binding Columns[\TypeColumn\], ElementName=ContactsGridView}"
SortDirection="Ascending" />
</telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>
I have a style that governs the several grids in my window. Here is that XAML:
<Style TargetType="{x:Type telerik:RadGridView}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="GridLinesVisibility" Value="None" />
<Setter Property="ShowGroupPanel" Value="False" />
<Setter Property="RowIndicatorVisibility" Value="Collapsed" />
<Setter Property="RowDetailsVisibilityMode" Value="Collapsed" />
<Setter Property="AutoGenerateColumns" Value="False" />
<Setter Property="CanUserFreezeColumns" Value="False" />
<Setter Property="SelectionUnit" Value="FullRow" />
<Setter Property="AutoExpandGroups" Value="True" />
<Setter Property="GroupRenderMode" Value="Flat" />
</Style>
Any ideas of what might be causing this error? I created a stripped down solution and couldn't duplicate the error message.