LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Also the Table control programming in CVI 6

Hi all,

After filling a table ,I found if click a column , all the cell pertain to it will be all selected , how to avoid the case ?

David
0 Kudos
Message 1 of 2
(2,899 Views)
David,

There is no built in function in the table control to disable that behavior; however, there are several ways you can create a workaround for this; here are some suggestions:

1.- Make your table control an indicator.
If you change the table to an indicator you can still listen to events on it, but you loose the capability to select some parts of the table. This is probably the easiest way to disable that behavior.

2.- Hide the Row and column header.
In the edit window of the table control you can hide the row and column label. What you can do here is to have 2 table controls, one on top of each other. Basically have your table without headers and use another table in the back just to show the labels.

3.- S
wallow the mouse click events when they are in the label area.

What you would do here is set a callback for the mouse click event, in that case you check for the coordinates of the mouse click and calculate whether or not the click was on the label; if the click took place in the headers, then you finish the function by returning any value other than 0, this way the table control will not receive the click event.

4.- Check if a the selection after a mouse click.
You can use PostDeferredCallback() to generate a second callback within you callback, in the second callback you would check if a hole row or column is selected, if this is the case then you can programmatically deselect the row/column.

I hope this helps, let me know if you have any other questions.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 2
(2,899 Views)