LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resizing LabView table with multirow automatically

Solved!
Go to solution

I have some unit parameters for my application, which will be shown on a button press in a dialogue box. The number of parameters for each unit varies (so the number of rows is not constant), and also sometimes due to text wrapping, rows are multi-line (varies from unit to unit, and how many lines is not known beforehand).

 

I'd like to display this data in a table, which only displays the rows that are filled (no empty rows). There is no minimum height of the table, but maximum is 252 pixels. If the length of the table (due to number of rows or height of multiline rows) is above 252, I'd like to display a vertical scrollbar, otherwise not.

 

What works:

- Showing data in a table in a dialogue box

- Changing the number of rows of the table according to the data

- Adding a vertical scrollbar based on number of rows

- Limiting the size of the table to 252 pixels

 

The problem:

- Multiline rows can make the data in the table arbitrarily longer than 252 pixels, without triggering the vertical toolbar due to a low number of rows.

 

I was thinking I could let the table autosize to the data, and then if height is over 252 then add a vertical toolbar and readjust it programatically to 252, but I can't find a way to get the table to autosize to the data.

 

Any ideas?

0 Kudos
Message 1 of 3
(2,574 Views)
Solution
Accepted by topic author lcmstill

Hi,

 

If I follow, you have a custom popup containing a table and you already have the functionality of showing only as many rows as needed, and the missing piece is the dynamically showing the scrollbars if the table exceeds a certain number of rows?

 

I've attached a quick VI which can show and hide the scrollbars using property nodes, and also report the width/height of the table with property nodes. I imagine it would be possible to use property nodes with some logic to trigger showing the scrollbars or not.

 

Mitch

0 Kudos
Message 2 of 3
(2,533 Views)

Thanks for your answer - actually I even already had dynamically showing the scrollbars, I was just overlooking the answer that was in front of me, but I figured it out 🙂

 

Cheers

0 Kudos
Message 3 of 3
(2,490 Views)