Devexpress.XtraTreeList click node

user983924 picture user983924 · Sep 6, 2013 · Viewed 8.7k times · Source

I have a Devexpress.XtraTreeList component. I want to catch in click event where the user is clicked on expand button or the node? How can I understand this?

Edit: Actually I am trying to do something like outlook using treelist. When I click the node, for example inbox, the messages in inbox are shown right side on the screen. When the user click another node, the treelist must be updated because some messages may be read. I did this functions in click event. It ıs OK. But in this case expand buttons functionality does not working normally.

Here is my problem

Answer

user983924 picture user983924 · Sep 9, 2013

I found the solution..

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