5

node.selected = false //Node becomes selected

Why? It is a valid question so I was trying to resolve a bug in one of our components that uses a TreeList of DevExpress and on the event AfterNodeFocus we raise an event to update the current object selection by putting the node selection to true and updating other values as well.

Well it seems that every thing is OK so why the fuck is this thing not working????

After 30 minutes into the problem realized that the event SelectionChanged is raise in the end of the AfterNodeFocus. Then realized that the event was running twice. One when I was setting the node.selection = true and after the event AfterNodeFocus but the list of selections were different. So what I discovered is the event SelectionChanged raised after AfterNodeFocus is using node.selection = !node.selection.

So how do I fixed it?

Before finishing AfterNodeFocus I set the selection of the node to false and voila the selection of items works now.

Well after 5 hours into the problem lets try another thing.

Comments
Add Comment