01-31-2013 10:41 PM
Hello All,
Am facing two problems:
1. I have two multicolumn events, one is value change for deleting the rows of Multicolumn listbox and another one is mouse up for sorting the columns. But I can't combine both the events in one case. And if I create two separate cases then each time the event of mouse up executes and sorting takes place irrespective of selection of delete event.
2. I have a selection VI in which user selects which parameter he wants to show it in a multicolumn listbox. I want this parameters to be retain or stored when next time I run the VI after closing it.
Am using LabVIEW 11. Pls reply soon.
Thanks & Regards,
Manisha
02-01-2013 02:04 AM
Assuming you only want to sort when clicking on the header, I would suggest that you call the MCLB's Point to Row Column method in the Mouse Up event and give it the click coords. Then, place the sorting code in a case structure and only execute it if row>=0.
As for retaining values, you can do something like this - https://decibel.ni.com/content/docs/DOC-15349
02-01-2013 02:51 AM
Thanks tst.
Will you be please give me a small example of the Point to Row Column method? I am trying this but not getting exactly what you want say.
One more thing I want to ask is, should I place sort arrow (like small triangle in windows application) on the column header of multicolumn listbox?
Thanks & Regards,
Manisha
02-01-2013 03:52 AM
I don't have LV in front of me, but you right click the control and select Create>>Invoke Node>>Point to Row Column. This will create an invoke node with the method. The method requires the point coordinates, which you can get from the Mouse Up event - one of the terminals on the left side should have that. The method then returns the row at that point, so you know if you clicked on the header.
As for the second question, I don't know if you should, but if you're asking if you can, then the answer is no. At least officially, LV does not have a MCLB with glyphs. What you can do is add the text /\ or V to the column's name using the Column Headers[] property.
02-01-2013 04:48 AM
Thanks tst,
Am attaching a VI, I have implemented what you are trying to say. Please suggest changes if you can.
Thanks & Regards,
Manisha
02-01-2013 05:49 AM - edited 02-01-2013 05:50 AM
What you are doing is correct but you also need to make sure that the row number is -1 as well to make sure its a header thats being clicked and not one of the cells.
02-01-2013 06:23 AM
Thanks aCe.
The attached snippet is not visible at my end after saving the image also. I have modified the VI as per your sugeestion. Pls attached the VI or change in my post itself. After running the VI, there is no sorting takes place? Why is it so?
Thanks & Regards,
Manisha
02-01-2013 06:30 AM
try this
02-01-2013 11:16 PM
Thanks aCe.
That works perfectly as I want. But there is a problem in deleting multiple rows. If select multiple rows by pressing ctrl button, it deletes more rows than the seleted one.
I have attached the VI. Please suggest the required chnages.
Thanks & Regards,
Manisha
02-02-2013 12:13 AM
one more thing, I want the first column of multicolumn listbox to be empty. I have to place boolean controls on that column. I know we can place symbol on that but I have to take status from that checkbox. Total number of columns is 20 so if I scroll the horizontal scrollbar the data scrolls on that controls. Is there any way to fix the first column of MCL like freeze panes in excel? Or any other way to fix this problem?
Thanks & Regards,
Manisha