This is a migrated thread and some comments may be shown as answers.
loading expander icon in treeview
2 Answers 29 Views
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 24 Jan 2011, 11:36 AM
Hi. Sometimes when I expand a tree node children won't load and the loading icon to the left of the node keep spinning (see picture attached). Up to now it only happend 3 times, but could you please let me know why it is doing it and if there is a fix?

Thanks,

Alex

2 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 24 Jan 2011, 02:41 PM
Hi Alex,

It is important what you do in your code behind - the LoadOnDemand event handler of the RadTreeView.
In order to stop the animation, you have to set the IsLoadingOnDemand property to true like so:


private
void radTreeView_LoadOnDemand(object sender, RadRoutedEventArgs e)
        {
            // get the treeview
            Telerik.Windows.Controls.RadTreeView tree = sender as Telerik.Windows.Controls.RadTreeView;
            // get the clicked Item
            RadTreeViewItem clickedItem = e.OriginalSource as RadTreeViewItem;
            // add the new items
            RadTreeViewItem newItem = new RadTreeViewItem()
            {
                Header = "New Item"
            };
            clickedItem.Items.Add(newItem);
            //System.Threading.Thread.Sleep(2000);
            clickedItem.IsLoadingOnDemand = false;
  
        }
Please let us know if this helps you or not. You can also provide a sample demosntrating your issue s that we could investigate in depth.

Regards,
Petar Mladenov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Alex
Top achievements
Rank 1
answered on 25 Jan 2011, 11:52 AM
I think you reply pointed me in the right direction! I marked it as an answer. I was setting isLoadingOnDemand to false, but I think there was a possibility in my code to skip that step. Should be sorted now though. thanks
Asked by
Alex
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Alex
Top achievements
Rank 1
Share this question
or