I have a VST using TriStateChecking. This is connected to a database table, so when the user checks a node, its checked field is updated in the database. I would like this to be invisible to the end user; that is no 'Save' button.
I am currently using the OnChecked() event to update the database. The problem is when checking large number of nodes, it essentially executes #CheckedNodes SQL update statements. What i would like to do is capture/be notified when all the tristatechecking is complete so i can simply scan the tree and con开发者_StackOverflowstruct one SQL update statement.
Is there an event i could use once all tristatechecking has completed?
No, the iteration is the only way to do it. Even CheckedCount property do it in this way.
Just have an internal list where you could store checked nodes and onChecked event update the list. When checking large number of nodes, just iterate through your list and construct SQL statement.
Just doing some tests, but it looks like i can simply use the OnMouseUp() event. Should have probably checked before, oops.
精彩评论