LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to update a table with a vertical scrollbar

Solved!
Go to solution

Hello,

 

I have a table with more columns than can be simultaneously displayed, so if the user is interested in one of the last columns, one has to use the vertical scrollbar.

 

Now the table is continuously populated with new data. These are added in a new row at the end of the table, and to allow reading the current data, I programmatically set the last row to be the active row using SetActiveTableCell (); this, however, is a problem because I need to specify a cell, ideally I would like to only specify a row - is it possible? Since I have not found a solution except SetActiveTableCell I also choose a column: If I choose say the first column then the vertical scrolling of the user will be reset on the next table update.

 

Suggestions are welcome, thanks!

 

Wolfgang

0 Kudos
Message 1 of 4
(3,487 Views)
Solution
Accepted by topic author Wolfgang

Don't know if this modifies also the column, but you can try with SetCtrlAttribute (..., ..., ATTR_FIRST_VISIBLE_ROW, index);

You could also save the leftmost visible column with the corresponding GetCtrlAttribute and ATTR_FIRST_VISIBLE_COLUMN attribute and restore it after changing the row.



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?
Message 2 of 4
(3,484 Views)

Roberto, thanks a lot!

 

SetCtrlAttribute (..., ..., ATTR_FIRST_VISIBLE_ROW, index) does the trick and also simplifies the code: using active table cell I first had to make the table invisible, set the active cell, and make the table visible again in order to avoid the jumping of the horizontal scroll bar.

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

You're welcome! Smiley Happy



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 4 of 4
(3,472 Views)