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

TreeView inside combo box binding issue

1 Answer 42 Views
TreeView
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:44 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

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 24 Sep 2009, 12:14 PM
Hi Rana Pratap,

the best will be if you could send us a project that we can investigate. Before that you can try access the web service separately - wihtout binding it to treeview. And also to try to give another source for the treeview to see where the problem comes from.

If the treeview is not inside combobox is everything working normally?

Greetings,
Valentin.Stoychev
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
TreeView
Asked by
Rana Pratap
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or