08-19-2008 12:23 PM
I'm trying to drag and drop using as much built-in LabVIEW functionality as I can. I would like to pull data from a column other than the first in a multicolumn listbox that has Highlight Entire Row enabled. I'd like to do it without catching events and creating a custom data cluster if I can help it (since I can't seem to auto-drop a custom cluster, so then I have to make a custom drop event too, which destroys all build-in functionality).
I have one multicolumn and two single-column listboxes, and the goal is to drag and drop between the two listboxes (move only) using native LabVIEW capability (works perfectly for my application). In addition, I'd like to drag from the multicolumn listbox to either single-column listbox (copy only). The first column in my actual application contains symbols (check boxes) and empty strings, so it doesn't work quite right (is this a flaw in LabVIEW?). If I drag the empty string (any row from the checkbox listbox), it inserts properly, but cannot be re-dragged. Also, it does not show up properly when I dump the contents to an indicator.
My question then is how to get data from some other column into the listboxes without bypassing LabVIEW's native drag and drop capabilities completely. The attached example (in 8.6 -- I can re-post in older version if necessary) shows the problem. Two multicolumn listboxes have been included to illustrate the differences, and to show the problem I am facing.
Thanks.
08-21-2008 04:34 PM
Hi,
Have you tried to use the LabVIEW Drag and Drop function? There are also some property nodes for listboxes which can be used to allow list boxes to accepts drops. They are called Allow Dropping.
Good Luck!
08-22-2008 08:04 AM
Perhaps I did not make myself clear. I know how to use the default drag and drop behavior. If you would take a look at the example VI that I have uploaded, you will find that the multicolumn listbox with the numeric data in the first column works well with drag and drop, as the data in the first column is automatically selected when "Highlight Entire Row" is enabled. However, the second multicolumn listbox with the ItemSymbols defined does not work properly.
So my question is this: is there a way to use another default column (other than column index 0) when dragging from a multicolumn listbox without disabling the default drag and drop functionality of the single column listboxes?
Alternatively, if I make a custom cluster of drag and drop data on the Drag Starting? event, can it be setup in a way that it is dropped automatically into the single column listbox using the default drop behavior?
08-25-2008 06:15 PM
Hi,
"Alternatively, if I make a custom cluster of drag and drop data on the Drag Starting? event, can it be setup in a way that it is dropped automatically into the single column listbox using the default drop behavior?"
I think this is possible using the LabVIEW Drag and Drop function (not the inherent one but the function itself, you aren't currently using this). There is an example program called Drag and drop that demonstrates this. The only thing is that this will return an error if it has no data to return, so ensure that you create a condition (yours can be mouse down) to enter into the event to allow the drop function. Set the data to be LV_LISTBOX_ITEMS
Hope this helps.