I am trying to set a gridview filterdescriptor in xaml.
The filterdescriptor looks like this:
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.
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
0
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?
Regards,
Dimitrina
Telerik
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>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?
In the mean time, are you saying that the radgridview filters don't support element binding?
0
Hello,
Yes, this is correct. Let me know how the suggested approach works for you.
Regards,
Dimitrina
Telerik
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!!!!!
While your solution will work, I would submit that it would sure be nice if your controls supported element binding!!!!!
0
Hi,
Thank you for your sharing your feedback.
Regards,
Dimitrina
Telerik
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.