This question is locked. New answers and comments are not allowed.
Hello
I am working with your sample here Telerik treeview sample .
I would like to set IsLoadOnDemandEnabled to false if there are no items returned in the context query.
Currently I am doing this, which appears to work:
I think it would make more sense if I could test the results of the Context.Load query, but I don't know how to do this.
Thanks.
I am working with your sample here Telerik treeview sample .
I would like to set IsLoadOnDemandEnabled to false if there are no items returned in the context query.
Currently I am doing this, which appears to work:
private
void
radTreeView_LoadOnDemand(
object
sender, Telerik.Windows.RadRoutedEventArgs e)
{
// get the clicked Item
RadTreeViewItem clickedItem = e.OriginalSource
as
RadTreeViewItem;
if
(clickedItem.Item
as
Customer !=
null
)
{
//_Context.Load(_Context.GetOrdersByCustomerIDQuery((clickedItem.Item as Customer).CustomerID));
var loadTree = _Context.Load(_Context.GetOrdersByCustomerIDQuery((clickedItem.Item
as
Customer).CustomerID));
loadTree.Completed += (s, ev) =>
{
//evaluate and disable load on demand?
if
(clickedItem.IsLoadingOnDemand)
{
clickedItem.IsLoadOnDemandEnabled =
false
;
}
};
}
else
if
(clickedItem.Item
as
Order !=
null
)
{
_Context.Load(_Context.GetOrderDetailsQuery((clickedItem.Item
as
Order).OrderID));
}
}
I think it would make more sense if I could test the results of the Context.Load query, but I don't know how to do this.
Thanks.