Tree in a DropDownButton blows up

4 posts, 0 answers
  1. Scott Michetti
    Scott Michetti avatar
    92 posts
    Member since:
    Feb 2010

    Posted 18 May 2010 Link to this post

    Hello. I get the following error when trying to load items dynamically into a RadTreeView that's in a RadDropDownButton on a RadWindow.
    "Error HRESULT E_FAIL has been returned from a call to a COM component."
    If the tree is not on a window it works fine. Or, if the tree is not in the RadDropDownButton it also works fine.
    Can you give me a workaround?
    Thanks

    Here's my code.

    //C#

     

    using

     

    System;

     

    using

     

    System.Collections.Generic;

     

    using

     

    System.Linq;

     

    using

     

    System.Net;

     

    using

     

    System.Windows;

     

    using

     

    System.Windows.Controls;

     

    using

     

    System.Windows.Documents;

     

    using

     

    System.Windows.Input;

     

    using

     

    System.Windows.Media;

     

    using

     

    System.Windows.Media.Animation;

     

    using

     

    System.Windows.Shapes;

     

    using

     

    System.Windows.Navigation;

     

    using

     

    Telerik.Windows.Controls;

     

    namespace

     

    WindowTest2

     

    {

     

    public partial class MainPage : Page

     

     

     

     

    {

     

    public MainPage()

     

    {

    InitializeComponent();

    btn.Click +=

    new RoutedEventHandler(btn_Click);

     

     

    RadTreeViewItem radTreeViewItem = new RadTreeViewItem();

     

    radTreeViewItem.Header =

    "All";

     

    tvLocations.Items.Add(radTreeViewItem);

    tvLocations.SelectedItem = radTreeViewItem;

     

    }

     

    void btn_Click(object sender, RoutedEventArgs e)

     

    {

    rwdFilters.ShowDialog();

    }

     

    }

    }

    //XAML
    <navigation:Page
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
               xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
               mc:Ignorable="d"
               xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
               xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" x:Class="WindowTest2.MainPage"
               d:DesignWidth="640" d:DesignHeight="480"
               Title="MainPage Page">
        <Grid x:Name="LayoutRoot">
      
      
      <telerikNavigation:RadWindow x:Name="rwdFilters" HorizontalAlignment="Right" Margin="0,0,0,0" VerticalAlignment="Top" Width="461" Height="384">
       <Canvas Width="450" Height="320">
        
        <telerik:RadDropDownButton x:Name="rddTree" Padding="0" DropDownWidth="215" DropDownHeight="300" Content="All" Width="200" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Canvas.Left="140" Canvas.Top="120">
         <telerik:RadDropDownButton.DropDownContent>
          <telerikNavigation:RadTreeView x:Name="tvLocations" Height="299" Margin="0,0,0,0" VerticalAlignment="Bottom"/>
         </telerik:RadDropDownButton.DropDownContent>
        </telerik:RadDropDownButton>     
       </Canvas>
      </telerikNavigation:RadWindow>
      <telerik:RadButton x:Name="btn" Height="51" HorizontalAlignment="Left" Margin="33,23,0,0" VerticalAlignment="Top" Width="127" Content="Button"/>
        </Grid>
    </navigation:Page>

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 21 May 2010 Link to this post

    Hi Scott,

     Could you please open a support ticket and send us a sample project that reproduces the problem? This would help us investigate what the problem is.

    Best wishes,
    Miroslav Nedyalkov
    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 banner
  4. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 May 2010 Link to this post

    Hello Scott,

     I received the project. Here is the answer if somebody else hit the same problem:
    I noticed that you placed the RadWindow control into the UserControl and this is not recommended. I moved the window to a separate XAML file (as a root tag) and this fixed the problem. Moving the window to separate XAML is demonstrated in our online example of the RadWindow control:  http://demos.telerik.com/silverlight/#Window/FirstLook.

    Kind regards,
    Miroslav Nedyalkov
    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.
  5. Scott Michetti
    Scott Michetti avatar
    92 posts
    Member since:
    Feb 2010

    Posted 02 Jun 2010 Link to this post

    Thanks. That fixed it.
    Scott
Back to Top