1

I already created a record which represents my node data and now, I want handle properly the event OnChange, for every time I click in a different node, it call the events once (not twice, this is my problem).

This tree shows a directory's structure of compressed files. Every time I click in an item of the tree, it loads the list of files contained in that folder. But when I use OnChange event and I click in an item (or I press up/down arrows keys), it calls the event twice making my application load the file list two times sequentially.

How can I use properly an event to load file list ONLY when the focused item change?

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
Thiago Dias
  • 121
  • 6
  • 2
    Have a look at the documentation. It states "Called when a node's selection state has changed.". When you use the debugger to inspect the `Node` parameter of your `OnChange` event, you'll notice that one time, it's set to nil. So you'll either have to do nothing when `Node` is `nil` or you use a more appropriate event: `OnFocusChanged` – Günther the Beautiful Mar 05 '15 at 18:18
  • 2
    Yes, that sounds like a job for `OnFocusChanged`. – TLama Mar 05 '15 at 19:35

0 Answers0