Binding errors on viewDefinitions' titles

6 posts, 0 answers
  1. Thierry
    Thierry avatar
    22 posts
    Member since:
    Mar 2012

    Posted 12 Dec 2012 Link to this post

    Hello,

    I noticed some binding errors in my output window that I could not explain at first:

    System.Windows.Data Warning: 40 : BindingExpression path error: 'Title' property not found on 'object' ''String' (HashCode=1191344071)'. BindingExpression:Path=Title; DataItem='String' (HashCode=1191344071); target element is 'ContentPresenter' (Name='Content'); target property is 'ResourceKey' (type 'String')

    after some meddling around, I finally found out that what was causing those errors where the viewDefinitions in the ScheduleView object.

    it appears that I always have as many binding errors as viewDefinitions, no matter how many viewDefinitions I add to the object. So I'm guessing something is wrong with the way the viewDefinition's Title property is bound in the template. (I add "blank" viewDefinitions, with nothing set, not even the title, and I get this error. NB: the title seems to be displayed correctly, though...)

    can you confirm this? or is this something on my side that I have not understood ?
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 13 Dec 2012 Link to this post

    Hi Thierry,

    This errors are caused by the way some controls are loaded in the Framework. When the application start some of the bindings get broken but shortly after that they are resolved and no exception is being thrown.

    You should worry about this errors.

    Greetings,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Thierry
    Thierry avatar
    22 posts
    Member since:
    Mar 2012

    Posted 13 Dec 2012 Link to this post

    Should I ? or should I not ?

    I cannot see what I can do to get rid of them :-/ they appear as soon as I add a viewDefinition to the RadScheduleView object
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 13 Dec 2012 Link to this post

    Hello Thierry,

    I apologize for my typo, you shouldn't worry about this errors.

    If you have any other questions do not hesitate to contact us again.

    Regards,
    Vladi
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. CHRISTOPH
    CHRISTOPH avatar
    3 posts
    Member since:
    Aug 2012

    Posted 09 Nov Link to this post

    As of UI for WPF R3 2016 (2016.3.1024) the errors still occur.

    Both ViewDefinitions and Bindings do work actually, but I dislike all the error messages during runtime:

    There is a binding error at initialization for every ViewDefinition added, and a binding error for each Binding within a ViewDefinition.

    The example below results in 23 (4 ViewDefinitions + 19 bindings) error messages:

    <telerik:RadScheduleView>
        <telerik:RadScheduleView.ViewDefinitions>
            <telerik:DayViewDefinition
                MajorTickLength="{Binding MajorTickLength}"
                MinorTickLength="{Binding MinorTickLength}"
                GroupHeaderDateStringFormat="{Binding DayStringFormat}"
                TimerulerMajorTickStringFormat="{Binding MajorTickStringFormat}"
                TimerulerMinorTickStringFormat="{Binding MinorTickStringFormat}" />
            <telerik:WeekViewDefinition
                MajorTickLength="{Binding MajorTickLength}"
                MinorTickLength="{Binding MinorTickLength}"
                GroupHeaderDateStringFormat="{Binding DayStringFormat}"
                TimerulerMajorTickStringFormat="{Binding MajorTickStringFormat}"
                TimerulerMinorTickStringFormat="{Binding MinorTickStringFormat}" />
            <telerik:MonthViewDefinition
                GroupHeaderDateStringFormat="{Binding WeekStringFormat}"
                TimerulerGroupStringFormat="{Binding DayOfTheWeekStringFormat}"
                TimerulerMajorTickStringFormat="{Binding DayOfTheMonthStringFormat}" />
            <telerik:TimelineViewDefinition
                MajorTickLength="{Binding MajorTickLength}"
                MinorTickLength="{Binding MinorTickLength}"
                GroupHeaderDateStringFormat="{Binding DayStringFormat}"
                TimerulerGroupStringFormat="{Binding DateStringFormat}"
                TimerulerMajorTickStringFormat="{Binding MajorTickStringFormat}"
                TimerulerMinorTickStringFormat="{Binding MinorTickStringFormat}" />
        </telerik:RadScheduleView.ViewDefinitions>
    </telerik:RadScheduleView>

     

    Each ViewDefinition produces an error similar to:

    System.Windows.Data Warning: 40 : BindingExpression path error: 'Title' property not found on 'object' ''String' (HashCode=-846991594)'. BindingExpression:Path=Title; DataItem='String' (HashCode=-846991594); target element is 'ContentPresenter' (Name='Content'); target property is 'ResourceKey' (type 'String')

     

    Each Binding produces an error similar to:

    System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=MajorTickLength; DataItem='SchedulerViewModel' (HashCode=48258167); target element is 'DayViewDefinition' (HashCode=50575939); target property is 'MajorTickLength' (type 'ITickProvider')

     

    I would really like to see those errors disappear, so I would like to ask if those errors could be fixed in an upcoming release. Or is there a workaround or proper usage which I am not aware of?

  7. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 15 Nov Link to this post

    Hello Christoph,

    Indeed, the error is still present with the latest release. Though you are receiving the errors and warnings in the Output Window, they should not affect the normal flow of your application. As my colleague has previously advised, the issue is caused by the Framework control loading mechanism. I have logged a public item - Improve ViewDefinitions "Binding Warnings" behavior. We will consider if it is possible to apply some workaround or rework the behavior. I encourage you to vote for the item so that its priority is increased.

    Regards,
    Stefan Nenchev
    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top
UI for WPF is Visual Studio 2017 Ready