03-18-2010 11:21 AM
I am using a multicolumn tree in Labview 8.6. I want the user to be able to edit column two of the tree for the leafs, but not the nodes. I am using the "edit cell?" filter event to test which cell row/column is being edited to determine whether to commit the changes the user has made. However, I am seeing some strange behavior and was hoping someone could point out if I am doing something wrong, or if it is a bug in Labview.
-- If I click twice slowly on the cell to enter edit mode, type the new text, and commit the changes by clicking a different cell of the tree, everything works as expected.
-- If I click twice slowly on the cell to enter edit mode, type the new text, and press Enter to commit the changes, the cell text reverts to the original text (this is not expected). However, when I change which cell has the focus by clicking on a second cell, the display updates and correctly shows the recently commited text.
-- If I remove the "edit cell?" filter event so that all changes are accepted, the tree display updates as expected.
If this is a bug in the Labview tree control, does someone know a way of forcing the control to repaint?
Thanks in advance,
Kevin
(sorry, I accidentally posted this under the Labwindows forum first. How do I remove a post?)
03-18-2010 04:53 PM
Try moving the terminal for 'Tree' into the 'Edit cell?' event. This fixed the update issue for me.
03-18-2010 04:57 PM
03-19-2010 02:08 PM
Thanks for the suggestion of putting the terminal for the tree in the "Edit Cell?" event case. However, when I try your fix in my actual program and not just a stripped down version I used as an example, the behavior unexpected behavior is still observed.
03-22-2010 10:46 AM
Hey kdm14,
It is strange that you aren't getting this issue with the example program, only with your main program. What happens if you run your main program in highlight execution? Do you seen anything that jumps out at you? Would you be able to post your main VI where the issue seems to be occurring?
03-22-2010 11:41 AM
03-22-2010 03:50 PM
Hmmm. event case does not work in the example program on my computer either.
-- If I click twice slowly on the cell to enter edit mode, type the new text, and commit the changes by clicking a different cell of the tree, everything works as expected.
-- If I click twice slowly on the cell to enter edit mode, type the new text, and press Enter to commit the changes, the cell text reverts to the original text (this is not expected). However, when I change which cell has the focus by clicking on a second cell, the display updates and correctly shows the recently commited text.
That makes me wonder if you two have different properties for Tree.MultilineInput?
And that may be a buggy thing . Probe it and find out- change both that property and Options:Advanced:Evironment:General:end text entry with enter key
There's only 4 cases so it might be interesting to check each one.
03-22-2010 04:43 PM
Thanks to everyone for the comments. I looked into the settings you suggested and couldn't find anything that worked. However, a work around I did stumble on is to create an additional event case for the "Edit Cell" event (not the "Edit Cell?" event) in which I used the Ensure Visible method of the tree on the newly changed tag. This causes the tree to be redrawn showing the correct text. If you look closely, you can see the cell quickly flicker back to the original text before being redrawn correctly. Suboptimal, but I guess I'll have to live with it.
Kevin