Devexpress.XtraTreeList click node

I have a component Devexpress.XtraTreeList. I want to catch a click event when they click on the extension button or the node button? How can I understand that?

Edit: Actually, I'm trying to do something like Outlook using a treelist. When I click on a node in the inbox, for example, messages in the inbox are displayed on the right of the screen. When the user clicks on another node, the twilist needs to be updated, because some messages can be read. I did this in a click event. All is well. But in this case, the functionality of the extension buttons does not work normally.

Here is my problem

+4
source share
3 answers

I found a solution ..

Thanks to everyone ..

private void treeList1_Click(object sender, System.EventArgs e) { DevExpress.XtraTreeList.TreeList tree = sender as DevExpress.XtraTreeList.TreeList; DevExpress.XtraTreeList.TreeListHitInfo info = tree.CalcHitInfo(tree.PointToClient(MousePosition)); if(info.HitInfoType == DevExpress.XtraTreeList.HitInfoType.Cell) ... // your code is here } 
+6
source

There is no event that fires when Node is clicked. However, here are some other events that may interest you:

AfterExpand - triggered immediately after the Node extension.

BeforeExpand - triggered before the Node extension.

FocusedNodeChanged - fires immediately after the Node focus changes (what happens when the user selects Node, regardless of whether they clicked on it or used the arrow to access).

I will also note that DevExpress has its own knowledge base with examples and sample code. It would be a great place to start your research for future questions: http://www.devexpress.com/Support/Center/

+2
source
  private void xtraTree_AfterFocusNode(object sender, NodeEventArgs e) { } 

You can handle the above event in the XtraTreeList control, and then retrieve the Node that the NodeEventArgs element was clicked on - e.Node

+1
source

Source: https://habr.com/ru/post/1500939/


All Articles