Profile Picture

Events in NTreeListNode with ContextMenu

Posted By Fabian Baptista 14 Years Ago
Author
Message
Fabian Baptista
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 18, Visits: 1
Caching node works!
Thanks one more time Angel.

Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hi Fabian,

You can get the node that context menu belongs to, by previously save reference to it in the event handler of NTreeLiset.ItemNotify event:  

NTreeListNode m_CurrentNode;

...

nTreeList1.ItemNotify += new NLightUIItemNotifyEventHandler(nTreeList1_ItemNotify);

...

void nTreeList1_ItemNotify(object sender, NLightUIItemNotifyData data)

{

    if (data.NotifyCode == NTreeList.ItemContextMenuDisplayingNotifyCode)

    {

        m_CurrentNode = (NTreeListNode)data.Sender;

    }

}

 

Then, when CommandClick event fires in the event handler you can use this cashed node.

Regards,

Angel.



Fabian Baptista
questionmark Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

Group: Forum Members
Last Active: 14 Years Ago
Posts: 18, Visits: 1
Hi, I'm using NTreeList, with NTreeNodes.
Each NTreeNode has a NContextMenu.

But, when CommandClick Event is fired, I don't know who was the Node "selected", since right click doesn't select any node.

How can I do this?
Thanks in advance
Fabián



Similar Topics


Reading This Topic