How to Use Busyindicator Inside List View Cell Image control

2 posts, 0 answers
  1. Rajesh
    Rajesh avatar
    3 posts
    Member since:
    Jun 2012

    Posted 27 Aug Link to this post

    How to Use Busyindicator Inside List View Cell Image control can you Provide the sample code for the same

    MY scenario is listview cell has image control and the image is loading from remote server i want show busy indicator on each cell till the image downloads

     

  2. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    414 posts

    Posted 28 Aug Link to this post

    Hello Rajsanil,

    You can how to show/hide the busy indicator by adding a boolean property to your model and bind the RadBusyIndicator's IsBusy property to that model property.

    For example, let's say your model has an IsImageDownloading property:

    public class MyModel : INotifyPropertyChanged
    {
         // ... other properties
     
        private bool isImageDownloading;
        public bool IsImageDownloading
        {
            get { return isImageDownloading; }
            set { isImageDownloading = value; OnPropertyChanged(); }
        }
     
        // INPC
    }


    Then in your template cell, you bind IsBusy to that property

    <listView:ListViewTemplateCell>
        <listView:ListViewTemplateCell.View>
            <primitives:RadBusyIndicator IsBusy="{Binding IsImageDownloading}">
                <primitives:RadBusyIndicator.Content>
                    <Image Source="{Binding ImageUrl}"/>
                </primitives:RadBusyIndicator.Content>
            </primitives:RadBusyIndicator>
        </listView:ListViewTemplateCell.View>
    </listView:ListViewTemplateCell>


    Regarding how to write code that determines if the image is downloading or not, that is outside the scope of Telerik controls. You can ask on StackOverflow or Xamarin forums. there are several different ways you can do this, you'll need to determine which one makes the most sense for you (the most common is to manually download the image using HttpClient).

    Regards,
    Lance | Tech Support Engineer, Sr.
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top