Expanding node differs from selected node

4 posts, 0 answers
  1. Casper Rafn
    Casper Rafn avatar
    1 posts
    Member since:
    Apr 2011

    Posted 11 Apr 2011 Link to this post

    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?

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 14 Apr 2011 Link to this post

    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
  3. DevCraft banner
  4. yjh
    yjh avatar
    67 posts
    Member since:
    Aug 2007

    Posted 01 Dec 2011 Link to this post

    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.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 Dec 2011 Link to this post

    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 >>

Back to Top