We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ScrollToBottom of the Listview when button clicks

Thread ID:





148076 Oct 4,2019 07:13 AM UTC Oct 8,2019 04:56 PM UTC Xamarin.Forms 1
Tags: SfListView
Asked On October 4, 2019 07:13 AM UTC

I am working on a chat application. When my chat window Loaded I executing "ListView_Loaded" in code behind it takes me to the bottom of the listview. when I click on the send message button my command executes in viewmodel there I am not able to scroll to the bottom of the listview. I have shared my code please have a look.

How do I use the Sflistview component in my ViewModel I have tried this solution but it's not worked.


//internal Syncfusion.ListView.XForms.SfListView ListView;

void SendMessage(object obj)


        var scrollView = obj as Syncfusion.ListView.XForms.SfListView;

        if (!string.IsNullOrWhiteSpace(MessageText))


            var msg = new ChatMessage


                MessageFrom = userFrom,

                MessageTo = userTo,

                Message = MessageText,

                TimeStamp = DateTime.UtcNow,

                RoomId = roomId



            MessageText = string.Empty;

            if (ChatGrouped.Count != 0)


                Device.BeginInvokeOnMainThread(() =>


                    //(ListView.LayoutManager as LinearLayout).ScrollToRowIndex(ChatGrouped.Count - 1, Syncfusion.ListView.XForms.ScrollToPosition.Start);

                    (scrollView.LayoutManager as LinearLayout).ScrollToRowIndex(ChatGrouped.IndexOf(ChatGrouped.Last()), Syncfusion.ListView.XForms.ScrollToPosition.End);






<Grid Padding="5" BackgroundColor="White">

            <ScrollView x:Name="scrollView" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">

                <syncfusion:SfListView x:Name="listView" IsStickyFooter="true" ItemSize="100"

ItemTemplate="{StaticResource MessageTemplateSelector}"

ItemsSource="{Binding ChatGrouped}" 



RowSpacing="12" ColumnSpacing="0"



LoadMoreCommand="{Binding LoadMoreItemsCommand}"

LoadMoreCommandParameter="{Binding Source={x:Reference Name=listView}}"           





                            <Frame Padding="0"










                                    <OnPlatform x:TypeArguments="x:Boolean">

                                        <On Platform="iOS">False</On>

                                        <On Platform="Android">False</On>



                                <Grid x:Name="MessageControls" RowSpacing="1" ColumnSpacing="2" BackgroundColor="Transparent">


                                        <ColumnDefinition Width="*"/>

                                        <ColumnDefinition Width="Auto"/>


                                    <control:BorderlessEntry Grid.Column="0"




                                                                 Placeholder="Type Something" 

                                                                 Text="{Binding MessageText, Mode=TwoWay}" />

                                    <Button Grid.Column="1" Text="Send" TextColor="AliceBlue" BackgroundColor="#9080eb"


                CommandParameter="{Binding Source={x:Reference Name=listView}}" 

                Command="{Binding SendMessageCommand}" >


                                            <OnPlatform x:TypeArguments="x:Double">

                                                <On Platform="Android" Value="100"/>

                                                <On Platform="iOS"  Value="80"/>











Sangeetha Raju [Syncfusion]
Replied On October 8, 2019 04:56 PM UTC

Hi Bharath, 
We would like to inform you that we have checked the reported query from our side. Unfortunately, we didn’t faced any issues as reported. We have attached the tested sample for your reference. Please find the sample from the below link. 
Can you please let us know whether the issue reproduces in our sample also? If not, please modify our sample to replicate the issue and revert us back.  
Sangeetha Raju. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon