LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Read cell of particular column on clicked row in table control

Hi All,

 

I have a table control in my panel. I have to find out the row on which user clicks and also read a particular cell in it. I will appreciate if someone can suggest how should I be doing it.

 

Thanks,

Kanu

0 Kudos
Message 1 of 4
(3,219 Views)

A good starting point is checking the samples provided with CVI...

 

 A particular cell can be obtained using

 

GetCtrlAttribute (panel, control, ATTR_TOP, &top);
GetCtrlAttribute (panel, control, ATTR_LEFT, &left);
GetTableCellFromPoint (panel, control, MakePoint (left, top), &activeCell);

0 Kudos
Message 2 of 4
(3,215 Views)

You can use:

 

Point  cell;

GetActiveTableCell (paneHandle, PANEL_TABLE, &cell);

 

See the online help for 'cell' parameter to understand how the Point structire is used.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 4
(3,209 Views)

Hi Wolfgang and Roberto,

 

Thanks for help. I was able get the index of row clicked using EVENT_TABLE_ROW_COL_LABEL_CLICK event for table control and the column inxed using GetTableColumnFromLabel(). After this, I used GetTableCellRangeVals() to read the cell.

 

Regards,

Kanu

0 Kudos
Message 4 of 4
(3,113 Views)