# Listformcomponent and show a specific row

**URL:** <https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104>\
**Category:** Questions\
**Created:** [November 8, 2023, 3:27pm UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104 "2023-11-08T15:27:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bodnarescu.diana](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bodnarescu.diana](https://forum.servoy.com/u/bodnarescu.diana)\
**Post date:** [November 8, 2023, 3:27pm UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104/1 "2023-11-08T15:27:49Z")

</div>

Hello,

Is it possible, in a listformcomponent, to show/scroll from code to a specific row?  
For example for the aggrid: foundset.setSelectedIndex(15) will automatically scroll the grid to the 15th row.

Thank you,  
Diana

---

<div class="post-metadata">

**Author:** ![bodnarescu.diana](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bodnarescu.diana](https://forum.servoy.com/u/bodnarescu.diana)\
**Post date:** [November 9, 2023, 11:55am UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104/2 "2023-11-09T11:55:05Z")

</div>

Or does anyone have some tricks to scroll to the bottom of the listformcomponent?  
I tried with:  
.ag-center-cols-viewport {  
display: flex;  
flex-direction: column-reverse;  
}  
but it did nothing for the scrollbar.

Would appreciate some ideas,  
Thank you,  
Diana

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [November 9, 2023, 12:10pm UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104/3 "2023-11-09T12:10:22Z")

</div>

Hi Diana,

did you look into using the plugins.ngclientutils.scrollIntoView() function?

---

<div class="post-metadata">

**Author:** ![bodnarescu.diana](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bodnarescu.diana](https://forum.servoy.com/u/bodnarescu.diana)\
**Post date:** [November 10, 2023, 7:59am UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104/4 "2023-11-10T07:59:38Z")

</div>

Hi Marc,

I tried with your suggestion,  
Unfortunately I could not make it work with the scroll of the listformcomponent, it is either not possible or I could not find the right selector (I also tried with the selectionClass).  
But thank you for the idea, good to know this option is there.

Diana

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [November 21, 2023, 1:53pm UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104/5 "2023-11-21T13:53:51Z")

</div>

why do you want to scroll to the bottom?  
And which bottom? of the currently loaded records (which are only a viewport of the thousands of records that you can have)?

Or really to the last record of the foundset so possible record number 1 million ?

If you want to see the last record sort the other way…

---

<div class="post-metadata">

**Author:** ![bodnarescu.diana](https://avatars.discourse-cdn.com/v4/letter/b/87869e/32.png) [@bodnarescu.diana](https://forum.servoy.com/u/bodnarescu.diana)\
**Post date:** [November 21, 2023, 2:51pm UTC](https://forum.servoy.com/t/listformcomponent-and-show-a-specific-row/21104/6 "2023-11-21T14:51:50Z")

</div>

Hi Johan,

Thank you for your reply.  
I was trying to build a chat using listformcomponent. To show the last message in a (normal) chat I need to scroll to the bottom of the list.

Since I could not build it using listformcomponent, I moved to building the chat in the aggrid. When you learn how to style the aggrid, it can look very nice ![:)]( "Smile")  
There if i set the foundset’s selectedIndex to the last record, scroll goes down to the bottom, although it often jumps a couple of records up.

```auto
//i build my qb
foundset.loadRecords(qb)
var size = databaseManager.getFoundSetCount(foundset)
foundset.setSelectedIndex(size)

```

It is an aggrid based on the form foundset, and I have max 50 records.  
I tried with running this piece of code in the onShow of the chat form, also before showing the chat form, and in both cases I get the same jumpy behavior.  
Any ideas in how to eliminate that will be very appreciated.

Thank you,  
Diana
