LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting full row on tables and grids in LV NXG

Hi All,

 

I've been experimenting with building a simple UI using NXG to display some tabular data.  The issue I'm running into is how to interact with the tables and grids in NXG.  One property standard labview allowed was indicating if the entire row would be highlighted when a user clicks on a specific row, I can't seem to find that option in NXG.  The next is having the ability to return the index of the row on the table that the user clicked on. 

 

I've tried creating a simple VI with an event structure that listens for a mouse down event and returns the index on that event, but I keep getting an index value of zero regardless of where the user clicks.

 

I can't seem to find much information about Tables and grids for NXG online so anything you can think off would really help.

 

Much appreciated,

0 Kudos
Message 1 of 9
(3,938 Views)

Hi Ozziee,

 

I tried your example and it does seem like the index event is not working. I will report file a bug report to the appropriate team. The Position of a mouse click is correctly reported from Event structure.  As a workaround, you could get the position of the click and normalize it to a index using the Table size and position to get an index. See below.

 

Do you have a simple example in CG of this? That would be helpful to compare the behavior.

 

Table Index.png

 

Table Index FP.png

Thanks,
Frank

0 Kudos
Message 2 of 9
(3,859 Views)

According to the documentation

http://www.ni.com/documentation/en/labview/latest/g-prog/not-fil-evnt/

The "Index" property is the Index of the event in the Event Structure, not the index of the selected row.

In CG, you would feed the "Position" into the Invoke node "Point to Row Column" to determine which row they clicked on.

I don't think a CG Table has a property for highlighting the entire row, but MultiColumn Listboxes do - maybe try that in NXG?

Message 3 of 9
(3,846 Views)

Thanks the reply.

 

You are correct regard CG, I was thinking of MC listbox, my mistake. However unless I'm not able to find it through quick drop or the pallet, LV NXG doesn't seem to have a multicolumn listbox, can't seem to find it in documentation either.

http://www.ni.com/documentation/en/labview/latest/ctrl-ref/selector-controls/

 

 

 

0 Kudos
Message 4 of 9
(3,843 Views)

Maybe try a datagrid?

http://www.ni.com/documentation/en/labview/latest/ctrl-ref/data-grid/

I think this is the intended replacement.

0 Kudos
Message 5 of 9
(3,840 Views)

Datagrids have similar functionality to tables. Difference being datagrids allow the columns to be of different datatypes (cluster), whereas tables are arrays (strings or I32).

 

0 Kudos
Message 6 of 9
(3,825 Views)

Thanks for pointing out that pauldavey. I tested with Data Grids, and I see the same behavior. XY Position is corrected but there is no simple way to convert to Column/Row index. As an immediate workaround, you would need to create your own Point to Index method for your table. This is not ideal and I will file a bug report for this missing functionality. 

 

Thanks,

Frank

0 Kudos
Message 7 of 9
(3,797 Views)

Ciao,

 

I have the some problem, is unbelievable that a simple functionality like this is missinig. In all my project in Labivew i have to interact with a selection of a multicolumn listbox.

Hoping NI fix this bug.

 

Ciao

0 Kudos
Message 8 of 9
(3,633 Views)

It's 12/1/2020.

It seems that the index on DataGrid has not been fixed. Does anybody know more about this?

0 Kudos
Message 9 of 9
(3,223 Views)