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

TreeView inside combo box binding issue

2 Answers 94 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rana Pratap
Top achievements
Rank 1
Rana Pratap asked on 22 Sep 2009, 03:46 PM
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 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 23 Sep 2009, 11:54 AM
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.
0
Valeri Hristov
Telerik team
answered on 23 Sep 2009, 11:57 AM
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.
Tags
ComboBox
Asked by
Rana Pratap
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or