The property 'HeaderTemplate' was not found in type 'HierarchicalDataTemplate'.

11 posts, 1 answers
  1. Chris
    Chris avatar
    3 posts
    Member since:
    May 2009

    Posted 26 May 2009 Link to this post

    Hi I am new to the RadConrols for silverlight.

    I am trying to use TreeControl and getting this error from VS 2008.

    (Warning)The property 'HeaderTemplate' does not exist on the type 'HierarchicalDataTemplate' in the XML namespace 'clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls'.

    (Error)The property 'HeaderTemplate' was not found in type 'HierarchicalDataTemplate'.

    This is sample xaml that I am trying...

     

    <UserControl x:Class="RadTreeViewWithWCF.Page" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
          
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
        xmlns:core="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
        xmlns:local="clr-namespace:RadTreeViewWithWCF" 
          
        Width="700" Height="500">  
          
        <UserControl.Resources> 
     
            <local:HierarchicalDataSource x:Key="Source" /> 
     
            <core:HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding Children}">  
                <core:HierarchicalDataTemplate.HeaderTemplate> 
                    <DataTemplate> 
                        <TextBlock Text="{Binding NodeText}" TextWrapping="Wrap" Width="400"/>  
                    </DataTemplate> 
                </core:HierarchicalDataTemplate.HeaderTemplate> 
            </core:HierarchicalDataTemplate> 
     
        </UserControl.Resources> 
     
        <Grid> 
     
            <telerik:RadTreeView  
                HorizontalAlignment="Left" 
                VerticalAlignment="Top" 
                ItemsSource="{Binding Source={StaticResource Source}}" 
                ItemTemplate="{StaticResource NodeTemplate}"   
                /> 
        </Grid> 
    </UserControl> 
     


    I appreciate in advance for any suggestions.

    Thank you
  2. Chris
    Chris avatar
    3 posts
    Member since:
    May 2009

    Posted 26 May 2009 Link to this post

    I tried the same XAML from the Expression Blend 2.

    And I am getting... (Error)The member "HeaderTemplate" is not recognized or is not accessible." - Line 16.

    Thanks
  3. DevCraft banner
  4. Answer
    Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 28 May 2009 Link to this post

    Hi Chris,

    I suppose you are using this example:
    http://blogs.telerik.com/kirilstanoev/posts/08-08-27/Populating_Silverlight_TreeView_from_WCF_Service_with_LINQ_to_SQL.aspx

    The blog post  happens to be a bit outdated and we will update it ASAP. I attached an example demonstrating the correct approach to use. I hope that this answers your question.

    Let me know if this solves your problem.


    Greetings,
    Boryana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Chris
    Chris avatar
    3 posts
    Member since:
    May 2009

    Posted 28 May 2009 Link to this post

    The new sample seems working OK.

    I get different error from VS 2008 as the following.
    (Error) AG_E_UNKNOWN_ERROR [Line: 18 Position: 39]
     C:\downloads\132090_radtreeviewwithwcf\RadTreeViewWithWCF\RadTreeViewWithWCF\Page.xaml 10 31 RadTreeViewWithWCF

    However the sample app runs fine.

    Thank you.
  6. naina
    naina avatar
    11 posts
    Member since:
    Jun 2009

    Posted 12 Feb 2010 Link to this post

    Getting following Error

     

    var rootNodes = this.unsortedList.Where(x => x.ParentID == x.NodeID);

     

     

    Error 3 'System.Collections.Generic.List<ClaimsRecovery_SL.TableItem>' does not contain a definition for 'Where' and no extension method 'Where' accepting a first argument of type 'System.Collections.Generic.List<ClaimsRecovery_SL.TableItem>' could be found (are you missing a using directive or an assembly reference?) C:\OLD PC\Web\ClaimsRecovery_SL\ClaimsRecovery_SL\ClaimsRecovery_SL\Views\Admin\HierarchicalDataSource.cs 42 47 ClaimsRecovery_SL


    I am not using LINQ.



     

    public

     

    HierarchicalDataSource()

     

    {

     

    // Create a new instance of the web service and get the data from the table

     

     

     

     

     

    AdminManagerClient menuAdmin = new AdminManagerClient();

     

    menuAdmin.GetParentInfoCompleted +=

    new EventHandler<GetParentInfoCompletedEventArgs>(menuAdmin_GetParentInfoCompleted);

     

    menuAdmin.GetParentInfoAsync();

    }

     

    private void menuAdmin_GetParentInfoCompleted(object sender, GetParentInfoCompletedEventArgs e)

     

    {

     

    // transfer all the items from the result to the unsorted list

     

     

     

     

     

    foreach (ParentMenuItem item in e.Result)

     

    {

     

    TableItem genericItem = new TableItem(item.Text, item.ItemID, item.ParentID);

     

     

    this.unsortedList.Add(genericItem);

     

    }

  7. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 15 Feb 2010 Link to this post

    Hello naina,

    You have to add the following using directive :
                            using System.Linq;
    Take a look at the following msdn article:
    http://msdn.microsoft.com/en-us/library/bb910018.aspx

    Best wishes,
    Boryana
    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.
  8. naina
    naina avatar
    11 posts
    Member since:
    Jun 2009

    Posted 17 Feb 2010 Link to this post

    Thanks for the reply.  code is working now.
    I have added checkbox in tree using following property  and while loading the tree all the checkbox that are previously selected should be selected.

    ItemsOptionListType="CheckList" IsOptionElementsEnabled="True"

  9. naina
    naina avatar
    11 posts
    Member since:
    Jun 2009

    Posted 19 Feb 2010 Link to this post

    I have create container binding

     

    <telerik:ContainerBinding PropertyName="CheckState"  Binding="{Binding IsChecked, Converter={StaticResource CheckStateConverter}}"/>

     

     



     

     

     

    <telerik:HierarchicalDataTemplate x:Key="NodeTemplate"

     

     

    ItemsSource="{Binding Children}"

     

     

     

     

     

    telerik:ContainerBinding.ContainerBindings="{StaticResource BindingsCollection}">

     

     

     

     

     

     

    <TextBlock Text="{Binding NodeText}" TextWrapping="Wrap" Width="400"/>

     

     

     

     

     

     

    </telerik:HierarchicalDataTemplate>

     

     

     


    And in source  I created property

     

       public bool IsChecked

            {

                get

                {

                    return this.isChecked;

                }

                set

                {

                    if (this.isChecked != value)

                    {

                        this.isChecked = value;

                        NotifyPropertyChanged("IsChecked");

                    }

                }

            }

     

    When this run NotifyPropertyChanged coming as null. 


    And class

    public class CheckStateConverter : IValueConverter

        {

     

            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)

            {

                bool result = (bool)value;

                return result ? ToggleState.On : ToggleState.Off;

            }

            public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)

            {

                ToggleState state = (ToggleState)value;

                return state == ToggleState.On ? true : false;

            }

     

     

        }

     

    Still not checking the check box at time of loading. Am I missing something? 

     

     

     

  10. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 25 Feb 2010 Link to this post

    Hi naina,

    Your code appears to be correct.

    There is a bug for ContainerBindings and the CheckState property. We are working on it and it should be resolved soon. It may be part of this week's internal build. Certainly it will be resolved for the coming release.

    Greetings,
    Miroslav
    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.
  11. Senthil Subramanian
    Senthil Subramanian avatar
    10 posts
    Member since:
    Jun 2010

    Posted 01 Oct 2010 Link to this post

    Hi,

    Sorry to open this thread after so long.

    Has this been fixed? Since I'm trying to use the same and I get the PropertyChanged as null. Not sure if it is a problem in my code or the issue still persists.

    Thanks & Regards
    Senthil
  12. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 Oct 2010 Link to this post

    Hello Senthil Subramanian,

     
    Yes, the bug has been fixed. I prepared a sample project illustrating such scenario that uses the latest versions of our controls. Please take a look at it and tell me if it helps.

    Feel free to ask if you need further assistance.

    Kind regards,
    Petar Mladenov
    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
Back to Top
DevCraft banner