This is a migrated thread and some comments may be shown as answers.

Cannot Find Governing FrameworkElement for FilterDescriptor

5 Answers 49 Views
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 16 Dec 2014, 04:10 AM
I am trying to set a gridview filterdescriptor in xaml. 

The filterdescriptor looks like this: 

<telerik:RadGridView.FilterDescriptors>
    <telerik:FilterDescriptor Member="Customer.Name" Value="{Binding Name, ElementName=gvWorkOrders.SelectedItem}"/>
</telerik:RadGridView.FilterDescriptors>

The idea is that gridview A automatically filters according to what is selected in gridview B. 

The full error is as follows:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Name; DataItem=null; target element is 'FilterDescriptor' (HashCode=61845703); target property is 'Value' (type 'Object')


Any ideas? I'm happy to post more code, just let me know what other information would help.

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 18 Dec 2014, 12:41 PM
Hello,

RadGridView.SelectedItem is an object and it seems its Name property cannot be properly resolved. Would you please try binding to a property from your view model and specify a valid source for the Binding?

For example:

<telerik:RadGridView.FilterDescriptors>
    <telerik:FilterDescriptor Member="Customer.Name" Value="{Binding SelectedItem.Name, Source={StaticResource MyViewModel}}" />
</telerik:RadGridView.FilterDescriptors>

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Eric
Top achievements
Rank 1
answered on 18 Dec 2014, 10:27 PM
I should have time to give that a shot in the next day or two.

In the mean time, are you saying that the radgridview filters don't support element binding?
0
Dimitrina
Telerik team
answered on 19 Dec 2014, 01:06 PM
Hello,

Yes, this is correct. Let me know how the suggested approach works for you.

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Eric
Top achievements
Rank 1
answered on 08 Jan 2015, 02:34 AM
I'm working on making my code more MVVM friendly, but it's going to be a while. 

While your solution will work, I would submit that it would sure be nice if your controls supported element binding!!!!!
0
Dimitrina
Telerik team
answered on 08 Jan 2015, 07:52 AM
Hi,

Thank you for your sharing your feedback. 

Regards,
Dimitrina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Asked by
Eric
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Eric
Top achievements
Rank 1
Share this question
or