Jump to content

TreeView - strange lost of selection


lraynal

Recommended Posts

For those who like to resolve strange bugs...

Here attached is a library where the main VI contains a Tree.

The "bug" is quite simple, I create a Tree with Cycles and SubFolders.

Each Cycle has a number of executions (written in the Tag and the Item of the Tree. Example "Cycle A - 5 executions").

Select a CYCLE, then change the number of executions (via the numeric control).

When the value reach 1, the Selection (of the ligne) is lost...

It's only when the value is above 2 that the Selection is kept!

I would be really happy if some of you would like to put an eye over this problem!

Thanks in advance.

Laurent

Download File:post-6600-1167924107.llb

Link to comment

The string you're generating for the Value of the tree is incorrect. When the value goes down to 1, the text you display in the tree is "Cycle A - 1 execution", but if you probe the string you're wiring into the Value property, it is "Cycle A - 1 executions". Since this is not a valid tree tag, no line is selected.

Also, I would recommend keeping an array of the tag names assigned to each row in the tree, and changing the Cell text for a row as it's changed, instead of re-writing the entire contents of the tree every time the number for a single row is changed.

-D

Link to comment
The string you're generating for the Value of the tree is incorrect. When the value goes down to 1, the text you display in the tree is "Cycle A - 1 execution", but if you probe the string you're wiring into the Value property, it is "Cycle A - 1 executions". Since this is not a valid tree tag, no line is selected.

Also, I would recommend keeping an array of the tag names assigned to each row in the tree, and changing the Cell text for a row as it's changed, instead of re-writing the entire contents of the tree every time the number for a single row is changed.

-D

OK! Here is the bug!

Nice to get a fresh mind on this kind of trouble!!! Thanks a lot.

(and by the way, I've posted this "bug" to NI via the support, as well...)

And thanks to the idea of keeping the array.

Cheers,

Laurent

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.