I was wondering if there is a way to disable the NodeCheckedChanged event from being fired for all children nodes when AutoCheckChildNodes is set to true.
The reason why I want to know this is that I store an xml string inside the tag of each node. Every node is a possible record in a database. The xml being stored inside each node contains the information for the current node along with all its children nodes. When the user checks or unchecks a node, I need to give this xml to another component which in turns inserts or removes the proper information to/from the database. I know I could keep raising this event for every node and simply keep the info for the current node in the tag, but this could make for a lot of back and forth between components and the database while this way only one call is being made.
I was thinking of keeping a flag inside the NodeCheckedChanged event and checking this flag before processing like the following:
but I noticed that the calls weren't nested and that it was actually doing all the code before moving on to the next child/sibling node.
Is there a workaround or another event I could use for this? I want to do the work only once and for the node that was actually checked/unchecked.
The reason why I want to know this is that I store an xml string inside the tag of each node. Every node is a possible record in a database. The xml being stored inside each node contains the information for the current node along with all its children nodes. When the user checks or unchecks a node, I need to give this xml to another component which in turns inserts or removes the proper information to/from the database. I know I could keep raising this event for every node and simply keep the info for the current node in the tag, but this could make for a lot of back and forth between components and the database while this way only one call is being made.
I was thinking of keeping a flag inside the NodeCheckedChanged event and checking this flag before processing like the following:
private void radTreeView1_NodeCheckedChanged(object sender, RadTreeViewEventArgs e) |
{ |
if (!m_processing) |
{ |
m_processing = true; |
// do work.... |
m_processing = false; |
} |
} |
Is there a workaround or another event I could use for this? I want to do the work only once and for the node that was actually checked/unchecked.