04-27-2011 12:25 PM
Hi,
I have a question about how sorting works with tree controls. Basically, it appears that when this event is fired in the callback, the items in the tree have not yet been sorted (as seen by calling GetValueFromIndex(...) on the items in the tree). I'm guessing, looking through the help file and the treeevent example, that this is here so that I can "swallow" a sort event based upon the sorting parameters, which are accessable through the eventData parameters. This seems reasonable. However, it appears that the EVENT_SORT is the last event fired when the user does a sort. So my question is, is there a way to trigger an event after the tree has been sorted in the callback, something like an EVENT_WAS_SORTED? (I could probably hack something together with a global and a timer or something like that, but is there something more clever I'm missing?) Thanks.
Solved! Go to Solution.
04-28-2011 12:07 PM
The best way I can think of to accomplish this would be to call PostDefferedCall from the EVENT_SORT event. We don't document that the tree will be sorted before future events are handled, but in all my testing, this happened to be the case. I've attached the simple test program I wrote to test this out.
NickB
National Instruments
04-29-2011 09:01 AM
Hi,
Thanks for the response. Your example code does exactly what I need to do and is a better solution than anything I had come up with. Kudos.