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

How to implement pull to refresh on List View

Here my code :

      private SfPullToRefresh pullToRefresh;

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var _rootView = inflater.Inflate(Resource.Layout.PullToRefersh, container, false);
            _rootView.SetBackgroundColor(Color.AliceBlue);

            var items = new List<string>();
            for (int i = 0; i < 100; i++)
            {
                items.Add(i.ToString());
            }
            var listAdapter = new ArrayAdapter<String>(this.Context, Android.Resource.Layout.SimpleListItem1, items);
            var listView = _rootView.FindViewById<ListView>(Resource.Id.List);
            listView.Adapter = listAdapter;


            pullToRefresh = new SfPullToRefresh(this.Context);
            pullToRefresh.Refreshed += PullToRefresh_Refreshed;

            pullToRefresh.PullableContent = listView;
            return _rootView;
        }

        private async void PullToRefresh_Refreshed(object sender, EventArgs e)
        {
            await Task.Delay(5000);
            pullToRefresh.Refresh();
        }


Attachment: Screenshot_1505383647_23954ea9.rar

3 Replies

AN Ashok N Syncfusion Team September 20, 2017 08:50 AM UTC

Hi Roy,    
    
Thanks for contacting Syncfusion support.     
    
We regret to inform you that currently we do not have support to implement ListView with SfPullToRefresh. Currently we working on this SfPullToRefresh control and this will be implemented in any of our upcoming volume release.     
    
Regards,    
Ashok    



RM Roy Morag replied to Ashok N October 1, 2017 07:43 AM UTC

Hi Roy,    
    
Thanks for contacting Syncfusion support.     
    
We regret to inform you that currently we do not have support to implement ListView with SfPullToRefresh. Currently we working on this SfPullToRefresh control and this will be implemented in any of our upcoming volume release.     
    
Regards,    
Ashok    


Hi Ashok,

I want to implement SfPullToRefresh on ListView  too and i am consider if to wait for your support or implement myself.

Please you can tell me when the update on SfPullToRefresh  that include supported on ListView  are expected to release date ? 


Thanks




VP Vimal Prabhu Manohkaran Syncfusion Team October 2, 2017 05:46 AM UTC

Hi Roy,

Works are in progress and in the final stages for the SfPullToRefresh control in Xamarin.Android platform. So you can expect the control with compatibility for the native ListView to be available from the 2017 Volume 4 Main Release which will be rolled out in the last week of October 2017 or first week of November 2017(tentative). We will update you once the release rolls out. We appreciate your patience until then.

Regards,
Vimal Prabhu
 


Loader.
Up arrow icon