Hierarchical DataBinding

6 posts, 1 answers
  1. dsoltesz
    dsoltesz avatar
    20 posts
    Member since:
    Jan 2008

    Posted 16 Dec 2008 Link to this post

    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>

     

     

     

  2. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 19 Dec 2008 Link to this post

    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.
  3. DevCraft banner
  4. dsoltesz
    dsoltesz avatar
    20 posts
    Member since:
    Jan 2008

    Posted 21 Dec 2008 Link to this post

    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:

     

  5. dsoltesz
    dsoltesz avatar
    20 posts
    Member since:
    Jan 2008

    Posted 21 Dec 2008 Link to this post

    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
  6. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 22 Dec 2008 Link to this post

    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.
  7. dsoltesz
    dsoltesz avatar
    20 posts
    Member since:
    Jan 2008

    Posted 22 Dec 2008 Link to this post

    That fixed the binding displaying the object type names instead of the binding values
Back to Top
DevCraft banner