04-11-2018 01:05 PM
Hi,
I am dragging files & folder from one tree control to another. Unfortunately, the tags change in the process. When dropped, the new tags seem to be the values of the first cell. That is a problem because I use the tag to save the file path.
I now want to read out all the tags of the dragged/dropped data to overwrite the automatically generated tags with the original ones. If I cannot use the same tag I could easily add a constant or something like that. That would also allow me to easily check if the selected tags have already been dropped and discard this event to prevent duplicate files.
I tried to read the tree data in the "Drag Starting?" event but cannot figure out how to get anything useful from the variant data. I saw the LV examples but that was not very useful to me. Basically, I am just trying to read the "LV_TREE_ITEMS" as a string, array of strings or something like that. I found info of what the format should be (Manual: 'Array of a cluster containing an array of strings, from left to right, in the item you are dragging, an integer representing the glyph index associated with the item from which you are dragging data, and an integer representing the indent level of the item from which you are dragging.') but was not able to use that information for the "Variant To Data" VI.
I am not used to the variant data type very much.
Any help is appreciated. I saved an example for Labview 14.
thanks!
Flumen
Solved! Go to Solution.
04-11-2018 01:34 PM
Here is the data type you need.
04-11-2018 01:34 PM
...after trying it for quite some time and almost giving up I figured it out right after I posted the above message.
I just used the wrong input to transform the variant data to what I needed. By going through the XML file I found the correct format, which is:
- Array of a cluster
- the cluster has 3-elements: 1D-string array, I31, I32
Unfortunately, is does not give me the tag as I hoped. But I can find the tags using the information.
I attached the solution
04-11-2018 01:35 PM
Thanks!
Just figured it out myself. We probably posted at the same time. 🙂
04-12-2018 08:17 AM
In the future, you might find this handy.
04-12-2018 07:22 PM
Thanks. Looks like it automatically creates the control you need based on the input data type, correct?
I am not sure how to use it, could you explain that in 1-2 sentences, please? I am sure I can figure the rest out myself.
04-13-2018 06:30 AM
04-13-2018 05:44 PM
I obviously tried that before but must have done something wrong when copying the data format.
Works now, thanks!