LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting a row from a table control through right-click menu

I have a table control. I want to delete a row from it when a user right clicks on a particular row and selects "Delete row" menu item. I have managed the creation of menu item but have not been able to delete the row which is right clicked and the menu item "Delete row" is selected. Guidance required! Thanks!
0 Kudos
Message 1 of 14
(3,356 Views)

Hi rashid,

if you already have the part to right click, here is the part to delete a row from the table. Hope it helps.

Mike

0 Kudos
Message 2 of 14
(3,353 Views)
That was great! Is there a way to get the row number from right click menu (without displaying a dialog box). I mean can we find out which table row was right-clicked and then feed it to delete from array function. (The default menu that appears at run time when table control is right click has that functionality built in. I wanted to know if I disable the right click default menu from appearing then how can I achieve the same effect programmatically).

Thanks for your time Mike! You are always such a great help!
0 Kudos
Message 3 of 14
(3,348 Views)

Hi rashid,

this function is only available if the table is a control, not an indicator.

Mike

0 Kudos
Message 4 of 14
(3,343 Views)
It's irrelevant whether the table is a control or indicator. See attached VI.
Message 5 of 14
(3,328 Views)
Now that was a great help! Thanks a lot smercurio…! Your vi was very, very helpful.

Have a nice day!
0 Kudos
Message 6 of 14
(3,321 Views)


smercurio_fc wrote:
It's irrelevant whether the table is a control or indicator. See attached VI.


Hi smercurio,
please see the attached picture. In my previous post i mean the different in the menu. The red marked function is not available, if the table is an indicator. LV8.5!
 
Mike


Message Edited by MikeS81 on 04-18-2008 05:19 PM
0 Kudos
Message 7 of 14
(3,311 Views)
Ah. Sorry, misunderstood your statement.

Still, the VI I posted should handle what the poster is trying to accomplish given that they're trying to use their own shortcut menu.
Message 8 of 14
(3,304 Views)
Dear smercurio…! Using your code I am able to delete a row or a column by using the cell position cluster and wiring it to delete from array function. But how do I delete a particular cell. Can you kindly have a look at the vi.

Thanks again!
0 Kudos
Message 9 of 14
(3,289 Views)
The Delete From Array function reduces the array in only one dimension, thus you cannot wire both the row and column inputs. Besides, how is the function supposed to know which way to move the elements? If you're deleting the cell in position (1,1) does this mean row 1 gets shifted left by one, or does this mean that column 1 gets shifted up by 1? You need to define this operation yourself and code it up to handle these two situations based, presumably, on a user selection, such as different menu items. This is how Excel basically works. If you try to delete a cell it pops up a dialog asking you what it should do.
0 Kudos
Message 10 of 14
(3,284 Views)