I have a gui table with a lot of data and every time I add or change data in the table, it goes to the top and i have to scroll down to the bottom. Is there a way to hold the gui table so it does not do this?

6 views (last 30 days)
I have a gui table with a lot of data and every time I add or change data in the table, it goes to the top of the chart and I have to scroll down to the bottom. Is there a way to hold the gui table so when I edit or add data to the table it goes to were the data is being added or to the very bottom?

Answers (1)

Walter Roberson
Walter Roberson on 30 Nov 2015
If it is a uitable() then there is no documented method of doing that. Some people go to the Java level as there is a scrolling position parameter available in the Java objects. However, Mathworks is changing the representation in a way that is going to make finding the Java objects more difficult.
The way to do it without using the undocumented Java level is to create a uipanel to hold the table, to set the Position height of the uitable to be large enough that it would not need any scroll bars, and then set the Position of the uitable table as the table grows so that the bottom of the table stays at the bottom of the uitable. You might also want to add a slider that allows you to change which portion of the uitable is visible.
Another way of phrasing this is that the Position of a uitable that is in a uipanel can give a height larger than the uipanel, and that you can keep changing the Position of the uitable to slide the uitable up or down within the uipanel.
(When you are doing this trick of moving something inside a uipanel to change what portion is visible on the screen, it often turns out to be easier to have two uipanel, one inside the other, with the outer one acting as a "window frame" and you move the inner one within that frame.)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!