twentysixpoint2
asked on
Syncronizing TreeView and CustomDraw event
Our application uses a treeview as its menu structure. Certain nodes in the tree represent forms that can be opened by clicking on the node. I have an issue with synchronizing the treeview when navigation to a target form is canceled. For example:
User updates FormA
User clicks the treenode that will cause them to navigate to FormB
Before FormB is opened, FormA is checked for updates
User is prompted to Save, Ignore, or Cancel updates
Cancel returns user to FormA and Form B is never opened
The problem is that the treeview will highlight FormB but FormA is still open.
I have a method that I call to synchronize the treeview to the form that is open. The method actually works but my custom DrawNode event fires at the end of all the processing and relselects the node that was clicked on.
Is there any way that I can cancel the DrawNode event or is there an event that is fired after the DrawNode that I can hook into? This is really driving me nuts.
User updates FormA
User clicks the treenode that will cause them to navigate to FormB
Before FormB is opened, FormA is checked for updates
User is prompted to Save, Ignore, or Cancel updates
Cancel returns user to FormA and Form B is never opened
The problem is that the treeview will highlight FormB but FormA is still open.
I have a method that I call to synchronize the treeview to the form that is open. The method actually works but my custom DrawNode event fires at the end of all the processing and relselects the node that was clicked on.
Is there any way that I can cancel the DrawNode event or is there an event that is fired after the DrawNode that I can hook into? This is really driving me nuts.
just wondering if you have checked NodeMouseClick event?
ASKER
Sameer -
Thanks for the input. Unfortunantly, the NodeMouseClick event does not work in this case. I have the call for my SyncMenu() method in a finally block in that event right now. I would have expected that to be the last bit of code to execute but the DrawNode event fires after that and that is where the node is being "incorrectly" highlighted.
Thanks for the input. Unfortunantly, the NodeMouseClick event does not work in this case. I have the call for my SyncMenu() method in a finally block in that event right now. I would have expected that to be the last bit of code to execute but the DrawNode event fires after that and that is where the node is being "incorrectly" highlighted.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.