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

ScrollToBottom of the Listview when button clicks

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"/>











1 Reply

SR Sangeetha Raju Syncfusion Team October 8, 2019 11:56 AM

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. 

Live Chat Icon For mobile
Up arrow icon