Cannot Find Governing FrameworkElement for FilterDescriptor

6 posts, 0 answers
  1. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 15 Dec 2014 Link to this post

    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.
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 18 Dec 2014 Link to this post

    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.

     
  3. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 18 Dec 2014 in reply to Dimitrina Link to this post

    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?
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Dec 2014 Link to this post

    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.

     
  5. Eric
    Eric avatar
    36 posts
    Member since:
    Apr 2013

    Posted 07 Jan 2015 Link to this post

    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!!!!!
  6. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 08 Jan 2015 Link to this post

    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.

     
Back to Top