Binding to HeaderTemplate

2 posts, 0 answers
  1. Edward
    Edward  avatar
    32 posts
    Member since:
    Jan 2008

    Posted 20 Jun 2011 Link to this post

    Sorry for the simple question, but this does not work:

    <telerik:RadMenuItem >
                <TextBlock Text="{Binding Something}" />

    But this works:

    <telerik:RadMenuItem Header="{Binding Something}" />
  2. Pana
    Pana avatar
    748 posts

    Posted 21 Jun 2011 Link to this post

    Hello Edward ,

    When you set the HeaderTemplate to DataTemplate the data context within will be the value of the Header property of the RadMenuItem. If you want to use the HeaderTemplate don't forget to set the Header.

    In other words the actual value that will be displayed within the RadMenuItem is the value of the Header property and the HeaderTemplate can be used to way the Header data is displayed.

    Best wishes,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top