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

Expanding node differs from selected node

3 Answers 66 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Casper Rafn
Top achievements
Rank 1
Casper Rafn asked on 11 Apr 2011, 04:21 PM

Hi all,
I am trying to implement MVVM, and are having issues with moving LoadOnDemand to my ViewModel using triggers and RelayCommands, I have the event firing and all,
but as it turns out it is possible to expand a node without having it selected, thus breaking the pattern, since the onLoad animation will continue to spin.

If I instead do this:

private void HierarchyTreeControl_LoadOnDemand(object sender, Telerik.Windows.RadRoutedEventArgs e)
RadTreeViewItem 
clickedItem = null; 
clickedItem = e.OriginalSource as 
RadTreeViewItem;
if (clickedItem != null)  { 
...do load logic

  in the code behind file I have access to the expanding item (clickedItem). What am I missing?

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 14 Apr 2011, 02:28 PM
Hello Casper Rafn,

Could you try setting  clickedItem.IsLoadingOnDemad = false after the "load" logic and let us know if it helps you? You can also send us more of your code so that we would be better able to get quickly into the problem.

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
yjh
Top achievements
Rank 1
answered on 02 Dec 2011, 04:45 AM
I think RadTreeView had better provide  a LoadingOnDemandItem property which indicate a RadTreeViewItem is in loading on demand state to bind to, Using mvvmlight's eventtocommand behavior is not a good choice, because viewmodel should not know RadTreeViewItem, just the it's datacontext ,a dataitem.
0
Petar Mladenov
Telerik team
answered on 06 Dec 2011, 03:01 PM
Hello Yjh,

Thank you for your suggestion. We'll consider implementing it in the future.

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TreeView
Asked by
Casper Rafn
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
yjh
Top achievements
Rank 1
Share this question
or