This is a migrated thread and some comments may be shown as answers.

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

10 Answers 186 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 26 May 2009, 04:52 PM
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

10 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 26 May 2009, 08:55 PM
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
0
Accepted
Bobi
Telerik team
answered on 28 May 2009, 07:43 AM
0
Chris
Top achievements
Rank 1
answered on 28 May 2009, 08:37 PM
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.
0
naina
Top achievements
Rank 1
answered on 12 Feb 2010, 07:41 PM
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);

 

}

0
Bobi
Telerik team
answered on 15 Feb 2010, 10:18 AM
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.
0
naina
Top achievements
Rank 1
answered on 17 Feb 2010, 05:15 PM

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"

0
naina
Top achievements
Rank 1
answered on 19 Feb 2010, 07:28 PM

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? 

 

 

 

0
Miroslav
Telerik team
answered on 25 Feb 2010, 12:08 PM
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.
0
Senthil Subramanian
Top achievements
Rank 1
answered on 01 Oct 2010, 02:46 PM
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
0
Petar Mladenov
Telerik team
answered on 06 Oct 2010, 04:40 PM
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
Tags
TreeView
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Bobi
Telerik team
naina
Top achievements
Rank 1
Miroslav
Telerik team
Senthil Subramanian
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or