LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set max. number of rows in a table?

Solved!
Go to solution

Hi,
I'm working on a SCADA interface. In this application there are different tables with vertical scroll bar.
I prefer to make visible only the initialized rows (I've initialized 40 blank rows of a table with a string array). Since the window not contain all 40 rows but only 20 rows, I set the rows number of "table properties window" to 20; so I added a vertical scroll bar.

Now, when a user scroll the scroll-bar, he can view not only the 40 rows initializated, but an undefined number of rows.
There's a way to visualize only a limited number of rows?

Thanks in advance!

0 Kudos
Message 1 of 4
(5,011 Views)
0 Kudos
Message 2 of 4
(5,002 Views)
Solution
Accepted by topic author Lucast85
The built-in scrollbars want to allow the user to add a new row on the end.
But sometimes that's not what you want.
 
I have moved to using separate scrollbar controls, not the builtin ones.
 
Place the scrollbar and stretch it so that it's the same height as the max number of rows you want to SHOW.
 
Then use this code when the number of ACTUAL rows changes:
 
Scroll.PNG
The "# Analyzers" is how many rows are in the actual array.
Then have an event when the Scrollbar changes, and set the INDEX property of the array to the value of the scrollbar.
 
Scroll 2.PNG
 
In my case, I control a bunch of arrays with one scroll bar. You might need only one.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 3 of 4
(4,990 Views)

There's another thing you can do, if the number of actual rows can get less than 20.

 

In the same place where you set the scrollbar properties, set the array's NUMBER OF ROWS to the LESSER of the number of rows you want to show, and the number of rows you actually have.

 

That will shrink up the array to fit the data.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 4
(4,958 Views)