NTreeViewEx - Cancel expand/collapse


Author
Message
Imanol Yurrebaso
Imanol Yurrebaso
Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)
Group: Forum Members
Posts: 15, Visits: 3
Thanks, I managed to use that in my code .
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Imanol,

Try to handle ItemNotify event as in following example code:

bool m_Clicked;

      void nTreeViewEx1_ItemNotify(object sender, NLightUIItemNotifyData data)
      {
         if (data.NotifyCode == NTreeViewEx.ItemLabelClickNotifyCode)
         {
            m_Clicked = true;
         }
                  
         if (data.NotifyCode == NTreeViewEx.NodeExpandingNotifyCode || data.NotifyCode == NTreeViewEx.NodeCollapsingNotifyCode)
         {
            if (m_Clicked)
            {
               data.Cancel = true;
               m_Clicked = false;
            }            
         }         
      }

Best Regards,
Nevron Support Team


Imanol Yurrebaso
Imanol Yurrebaso
Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)Junior Member (15 reputation)
Group: Forum Members
Posts: 15, Visits: 3
Hello,

In my NTreeViewEx, I capture the double click event and perform a certain operation with the text of that node. Additionally, following the behaviour of the NTreeViewEx, the node will collapse or expand depending on the previous state. I would like to avoid that behaviour, but still allowing the user to expand or collapse the nodes by using the +/- symbol.

I managed to capture the collapsing/collapsed/expanding/expanded events with the ItemNotify event, but I cannot find the way of cancelling the action. Any ideas?

PS: as I asked some questions here already and received good replies, I would like to thank the wonderful work of the Nevron Support Team .
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search