# Table show last entry at bottom (move slider)

**URL:** <https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810>\
**Category:** Ignition\
**Created:** [May 6, 2010, 2:01pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810 "2010-05-06T14:01:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamabelew](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@adamabelew](https://forum.inductiveautomation.com/u/adamabelew)\
**Post date:** [May 6, 2010, 2:01pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/1 "2010-05-06T14:01:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [May 6, 2010, 2:44pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/2 "2010-05-06T14:44:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![adamabelew](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@adamabelew](https://forum.inductiveautomation.com/u/adamabelew)\
**Post date:** [May 6, 2010, 5:05pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/3 "2010-05-06T17:05:09Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [May 6, 2010, 9:23pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/4 "2010-05-06T21:23:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [April 2, 2013, 8:37pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/5 "2013-04-02T20:37:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [April 2, 2013, 9:40pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/6 "2013-04-02T21:40:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [April 3, 2013, 12:55pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/7 "2013-04-03T12:55:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [April 3, 2013, 4:33pm UTC](https://forum.inductiveautomation.com/t/table-show-last-entry-at-bottom-move-slider/1810/8 "2013-04-03T16:33:03Z")

</div>

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 - 1`since it starts at 0.
