Binding in EmptyContentTemplate

3 posts, 0 answers
  1. Igor
    Igor avatar
    29 posts
    Member since:
    Mar 2012

    Posted 10 Mar 2014 Link to this post

    Is there a way to use binding in EmptyContentTemplate? My ViewModel has a Name property that I want to use in a Run in the EmptyContentTemplate, but I am getting

    System.Windows.Data Error: BindingExpression path error: 'Name' property not found on '' 'System.String' (HashCode=757602046). BindingExpression: Path='Name' DataItem='' (HashCode=757602046); target element is 'System.Windows.Documents.Run' (Name='null'); target property is 'Text' (type 'System.String')..

    It looks like the EmptyContentTemplate does not even now about the ViewModel and has its DataContent set to some string.
  2. Igor
    Igor avatar
    29 posts
    Member since:
    Mar 2012

    Posted 10 Mar 2014 Link to this post

    The tricks seems to be to set EmptyDataContent="{Binding}"
  3. DevCraft banner
  4. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 13 Mar 2014 Link to this post

    Hi Igor,

    Thanks for writing.

    Yes, that's what you need to do to get it working.

    Regards,
    Deyan
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
Back to Top