TreeView inside combo box binding issue

3 posts, 0 answers
  1. Rana Pratap
    Rana Pratap avatar
    16 posts
    Member since:
    Sep 2009

    Posted 22 Sep 2009 Link to this post

    Hi,

    I have a requirement where i need to get data from web service and bind it to treeview. This treeview should be inside combobox.

    I am facing issue when i click on combo box , i am getting the following java script  error "sys.invalidoperationexception managedruntimeerror error 4004 in control 'silverlight1' " in browser. It worked fine for the first time. Please help me on this.

    my XAML code

     <telerikInput:RadComboBox  x:Name="ddltreeviewFilters" Height="30"  Margin="40,0,20,95" Width="200" >
                <telerikNavigation:RadTreeView  x:Name="tvFilters" SelectionMode="Multiple" >
                </telerikNavigation:RadTreeView>
      </telerikInput:RadComboBox>

    XAML.cs code for binding treeview

      if (e.Result.Count > 0)
                    {                  
                        RadTreeViewItem tviPublicFilters = new RadTreeViewItem();
                        tviPublicFilters.Header = "PublicFilters";

                        for (int i = 0; i <= e.Result.Count; i++)
                        {
                            if (e.Result[i].PublicFilter == 1)
                            {
                                tviPublicFilters.Items.Add(new RadTreeViewItem() { Header = e.Result[i].FilterName });

                            }
                            tvFilters.Items.Add(tviPublicFilters);
                            
                        }
                    }

    Please help me on this Thanks in advance
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 23 Sep 2009 Link to this post

    Hi Rana,

    I would recommend using one of the two ways to put a RadTreeView in RadComboBox from the following blog post:
    http://blogs.telerik.com/valerihristov/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx

    All the best,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 23 Sep 2009 Link to this post

    Or, I just remembered, you could use RadDropDownButton from our new button suite, that is currently in beta:
    http://demos.telerik.com/silverlight/beta/#Buttons/DropDownButton

    Greetings,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top