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

Hierarchical DataBinding

5 Answers 168 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
dsoltesz
Top achievements
Rank 1
dsoltesz asked on 16 Dec 2008, 09:14 PM
I'm trying to get Hierarchical databinding to work but the templates are giving errors in the xaml file.
Is there a complete example on how to get this to work with the RadPanelBar

 <telerik:RadPanelBar x:Name="bar" ItemsSource="{Binding}">

 

 

    <ItemTemplate> -error

 

        

<HierarchicalDataTemplate ItemsSource="{Binding Products}">

 

             

<DataTemplate>

 

                 

<TextBlock Text="{Binding Name}" Foreground="Red" />

 

            

</DataTemplate>

 

             

<ItemTemplate>

 

                 

<StackPanel Orientation="Horizontal">

 

                     

<TextBlock Text="{Binding Name}" />

 

                     

<TextBlock Margin="10,0,0,0" Text="{Binding Description}" />

 

                 

</StackPanel>

 

             

</ItemTemplate>

 

         

</HierarchicalDataTemplate>

 

     

</ItemTemplate>

 

 

</telerik:RadPanelBar>

 

 

 

5 Answers, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 19 Dec 2008, 03:20 PM
Hi dsoltesz,

Thank you the feedback. The problem is already fixed and the changes will be released in the next service pack.

For now please find attached the fixed dll as well as a sample PanelBar application that uses Hierarchical data binding.

Regards,
Boryana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
dsoltesz
Top achievements
Rank 1
answered on 22 Dec 2008, 02:33 AM
This does fix the hierarchicial databinding but it breaks any other controls on the InitializeComponent();

If you just add a combo box to your sample page.xaml you will get the error.  I've confirmed the dlls you supplied break the combobox and the radupload on the InitializeComponent();

<input:RadComboBox>

<input:RadComboBoxItem Content="TEst1" ></input:RadComboBoxItem>

<input:RadComboBoxItem Content="Test2" ></input:RadComboBoxItem>

</input:RadComboBox>

System.Windows.Markup.XamlParseException occurred
  Message="System.TypeInitializationException: The type initializer for 'Telerik.Windows.Controls.RadComboBox' threw an exception. ---> System.MissingMethodException: Method not found: 'Telerik.Windows.DependencyPropertyKey Telerik.Windows.DependencyPropertyExtensions.RegisterReadOnly(System.String, System.Type, System.Type, Telerik.Windows.PropertyMetadata)'.\r\n   at Telerik.Windows.Controls.RadComboBox..cctor()\r\n   --- End of inner exception stack trace ---\r\n   at System.Runtime.CompilerServices.RuntimeHelpers._RunClassConstructor(IntPtr type)\r\n   at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle type)\r\n   at System.Windows.DependencyObject.OnBeforeCoreCreate(Type type)\r\n   at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr& nativePeer, UInt32 isCreatedByParser) [Line: 0 Position: 0]\r\n   --- Inner Exception ---\r\nThe type initializer for 'Telerik.Windows.Controls.RadComboBox' threw an exception.\r\n"
  LineNumber=0
  LinePosition=0
  StackTrace:
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at LikeYouFor.Content.UserQuestionsPage.InitializeComponent()
       at LikeYouFor.Content.UserQuestionsPage..ctor()
  InnerException: System.TypeInitializationException
       Message="The type initializer for 'Telerik.Windows.Controls.RadComboBox' threw an exception."
       TypeName="Telerik.Windows.Controls.RadComboBox"
       StackTrace:
            at System.Runtime.CompilerServices.RuntimeHelpers._RunClassConstructor(IntPtr type)
            at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle type)
            at System.Windows.DependencyObject.OnBeforeCoreCreate(Type type)
            at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr& nativePeer, UInt32 isCreatedByParser)
       InnerException: System.MissingMethodException
            Message="Method not found: 'Telerik.Windows.DependencyPropertyKey Telerik.Windows.DependencyPropertyExtensions.RegisterReadOnly(System.String, System.Type, System.Type, Telerik.Windows.PropertyMetadata)'."
            StackTrace:
                 at Telerik.Windows.Controls.RadComboBox..cctor()
            InnerException:

 

0
dsoltesz
Top achievements
Rank 1
answered on 22 Dec 2008, 03:05 AM
I upgraded to the latest hotfix 2008.3 1217 and the initializeComponent errors went away.  The template for the radpanel is working but binding is displaying the name of the binding object as opposed to the values now.

I've update the sample you originially provide to demostrate the issue.  Please run the testpage.html in the bin/debug folder
0
Accepted
Valentin.Stoychev
Telerik team
answered on 22 Dec 2008, 02:53 PM
Hello dsoltesz,

Yes - the reason is that the hotfix that we made was AFTER the SP that we released. I'm attaching all dlls, together with the hotfix version.

Let us know how it goes.


All the best,
Valentin.Stoychev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
dsoltesz
Top achievements
Rank 1
answered on 22 Dec 2008, 04:23 PM
That fixed the binding displaying the object type names instead of the binding values
Tags
PanelBar
Asked by
dsoltesz
Top achievements
Rank 1
Answers by
Bobi
Telerik team
dsoltesz
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or