Table show last entry at bottom (move slider)

I have a table in a window that is bound to a table in MSSQL. When there are more lines in the table than are visible in the table in the window the slider bar appears on the right side; this is good. What I am looking to do is have the last entry visible when it is updated.

I require the data to be shown in ASCending order. I know I can ORDER BY DESCending order and this will show the data at the top of the window. The data does get updated in the table, but the slider does not move down to show this new record.

Does anyone have any ideas?

Thanks

A quick hack would be to programmatically set the selected row to the row that you just updated (or any other row of your choice). I just tried it, and the scroll bar moved down to the bottom. And, if you don’t want it to stay selected, you can set the selected row back to -1 and the scroll bar still stays where it is.

Maybe someone else has a better way.

I tried what you suggested and it is working. It did take a bit of “hacking” but it is functioninal.

Is there a clean method of doing this? Can there be a property that is not listed that might perform this function?

Thanks again…

I think that “hack” is going to be your best bet.

on internalframeactivated

data = system.gui.getParentWindow(event).getComponentForPath('Root Container').dataset system.gui.getParentWindow(event).getComponentForPath('Root Container').selectedrow = data.rowCount

I am trying to set the selected row to the max number of rows in my dataset…It’s not right and it isn’t passing the number of rows to my property.

Not sure what your question is. Is the data loaded when this script runs? Why aren’t you using a property binding?

I am trying to do exactly what adamabelew was.
I thought that my script would accomplish that…

If I try to bind selected row to a property, what might that be?
I thought .rowCount would be the way to go so it would make the selected row the same as the max in the table.

It needs to be rowCount - 1:data = system.gui.getParentWindow(event).getComponentForPath('Root Container').dataset system.gui.getParentWindow(event).getComponentForPath('Root Container').selectedrow = data.rowCount - 1since it starts at 0.