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

GetItemByPath returns null when RadBusyIndicator.IsBusy is true

4 Answers 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Todd asked on 24 May 2011, 05:29 PM
In our UI, we set the RadBusyIndicator.IsBusy to true while we make a web service call to get data to populate a RadTreeView control.  When we make updates to the data, we do the same thing: Set the RadBusyIndicator to Busy, make the call to the web service, update the treeview, and then set the RadBusyIndicator.IsBusy to false.

When we update the treeview, we want to select a particular node, and expand the tree to that node.  We do this by calling RadTreeView.GetItemByPath.  This works great when the RadBusyIndicator is not busy, but when it is busy, GetItemByPath always returns null.  We do need to block the user during this operation, because we want to prevent concurrent web service calls.

We have tried updating the treeview after the RadBusyIndicator.IsBusy is set to false. However, because there is a bit of a lag before the RadBusyIndicator actually is dismissed, the call still fails.

// This block fails -- item is always null while BusyIndicator is shown
private void btnShowBusyIndicator_Click(object sender, RoutedEventArgs e)
{
    busyIndicator.IsBusy = true;
    RadTreeViewItem item = tvTest.GetItemByPath("RootItem|SubItem 1|SubItem 3", "|");
    if (item != null)
    {
        item.IsExpanded = true;
        item.IsSelected = true;
    }
    busyIndicator.IsBusy = false;
}
 
// This block is successful -- a valid item is returned from GetItemByPath
private void btnNoBusyIndicator_Click(object sender, RoutedEventArgs e)
{
    RadTreeViewItem item = tvTest.GetItemByPath("RootItem|SubItem 1|SubItem 3", "|");
    if (item != null)
    {
        item.IsExpanded = true;
        item.IsSelected = true;
    }
}

Is this a bug that can be fixed in the next release?  Or is there a good workaround?

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 27 May 2011, 03:21 PM
Hello Todd,

Unfortunately, we are unable to reproduce this issue at our side. Could you please try to isolate your problem in a sampler scenario or you can send us a support ticket so that you will be able to attach files? This way we could investigate this better and provide you with an advice or better suited solution. Thank you in advance for your situation.

Kind regards,
Petar Mladenov
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
0
Todd
Top achievements
Rank 1
answered on 27 May 2011, 03:46 PM
I have opened a support ticket/bug report and sent a sample program that illustrates the problem.

Some clarification:

If the tree has been expanded at some point, either programatically or manually, GetItemByPath returns a valid RadTreeViewItem.  However, calls to expand or select that node don't seem to work -- if the tree is collapsed and the busy indicator is being shown, the tree stays collapsed.

If the tree has never been expanded, either manually or programatically, GetItemByPath returns a null when the BusyIndicator is shown, and a valid value when the BusyIndicator is not shown.
0
Petar Mladenov
Telerik team
answered on 01 Jun 2011, 03:20 PM
Hello Todd,

Unfortunately, we are unable to find your support ticket. Could you please provide ticked ID or link or the email address of the sender of the ticket ? Thank you in advance.

All the best,
Petar Mladenov
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
0
Todd
Top achievements
Rank 1
answered on 01 Jun 2011, 03:34 PM
For some reason, my support ticket disappeared.  I resubmitted it, along with the sample code.  The ticket number is 430150.
Tags
TreeView
Asked by
Todd
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Todd
Top achievements
Rank 1
Share this question
or