Treeview - preventing node selection
-
Hi, Upon clicking a treeview node, the following events fire (correct me if I am mistaken) - Click and AfterSelect. In the Click event I want to perform a test and optionally prevent the node that was clicked upon from being selected. I think I have to prevent the execution flow from reaching AfterSelect? Is there a way of "cancelling" the click event or otherwise achieving this? I do have a work around - a form level boolean variable that I set True if I want to cancel - in AfterSelect if this is set True then it exits the AfterSelect event handler function. But this seems at best a kludge. Many thanks in advance! - Anthony
-
Hi, Upon clicking a treeview node, the following events fire (correct me if I am mistaken) - Click and AfterSelect. In the Click event I want to perform a test and optionally prevent the node that was clicked upon from being selected. I think I have to prevent the execution flow from reaching AfterSelect? Is there a way of "cancelling" the click event or otherwise achieving this? I do have a work around - a form level boolean variable that I set True if I want to cancel - in AfterSelect if this is set True then it exits the AfterSelect event handler function. But this seems at best a kludge. Many thanks in advance! - Anthony
AnthonyEllis wrote:
But this seems at best a kludge.
Sometimes that just happens to be the only case.
"I really like comments where I don't have to answer stupid questions" - stfx