04-19-2017 07:58 AM
Hey All, I've got a few questions regarding multicom listboxes
My biggest one is on input controls. What is the easiest way to set up a listbox so a user can only insert numbers into the cells?
Bonus round:
I want to pass data from one listbox to another, is the only way to do that with the individual property nodes?
04-19-2017 09:01 AM
I had a similar issue once where I wanted a user to enter a calibration due date. To avoid having to deal with a multitude of different ways to indicate a date I used an interface with a calendar control to select the date, I was then assured that the date will always have the same format. The user select the row and click the Modify button.
You can do something similar where the user select a number from a numeric control, then you convert it to a string before writing the value to the MCL.
Ben64
04-19-2017 09:25 AM
What do you want to happen if the user inserts something else?
The way that I can think of is to have an event for the filter event 'Edit Cell?' and then parse the string after the change. If it matches your conditions, wire false to the discard event and your parsed string to the String output. If it doesn't, wire true to discard. No edit will be made.
A simple example (allowing 'yes', but nothing else) is below as a snippet.
04-19-2017 10:26 AM
04-19-2017 11:12 AM
I'm guessing that you meant Ben's solution, since mine was drag-droppable, but I'd guess and say what he has is a 'dialog' window style VI with an event structure using the events 'OK: Value Change' and 'Cancel: Value Change' and outputting a cluster or string array of data values, possibly along with a boolean to say if the dialog was cancelled/accepted, and if needed a local variable in the 'OK' event case to output the changed values, with the 'Cancel' event case just wiring the control right through to a hidden indicator.
04-19-2017 12:02 PM
Here's a very simplified version, the original uses an xml file to keep track of the data. The example uses an express dialog box but the original uses a custom dialog vi that load the current selected MCL row values into the dialog box. In the original you can also add, insert and delete rows and print the list.
You can use the example as a starting point, I did it rapidly so there's probably a lot of room for improvement.
Ben64
04-19-2017 12:06 PM
Here's a trick I use sometimes when I want a cell to have special behavior.