New to Telerik UI for WinForms? Download free 30-day trial

Data Binding

Bound mode

RadPipsPager provides built-in option to bind the control to any collection by using the BindingSource property. When in bound mode the RadPipsPager automatically changes the Position of the BindingSource. The number of the pips is also calculated automatically based on the used data.

The following example demonstrates a basic scenario where RadPipsPager is used with RadSlideView. Here, RadPipsPager is bound to a BindingList of a custom object:

Bind RadPipsPager

BindingSource bindingSource = new BindingSource();
BindingList<Person> list = new BindingList<Person>()
{
new Person("1", "Nancy Davolio"),
new Person("2", "Andrew Fuller"),
new Person("3", "Janet Leverling"),
new Person("4", "Margaret Peacock")
};
bindingSource.DataSource = list;
this.radPipsPager1.BindingSource = bindingSource;

//bind slide view to show data
LightVisualElement template = new LightVisualElement();
this.radSlideView1.Mappings.Add(new Mapping(template, LightVisualElement.TextProperty, nameof(Person.Name)));
this.radSlideView1.TemplateElement = template;
this.radSlideView1.BindingSource = bindingSource;

Sample Data Object

public class Person : INotifyPropertyChanged
{
    private string id;
    private string name;
    public event PropertyChangedEventHandler PropertyChanged;
    public Person(string id, string name)
    {
        this.id = id;
        this.name = name;
    }
    public string Id
    {
        get
        {
            return this.id;
        }
        set
        {
            if (this.id != value)
            {
                this.id = value;
                OnPropertyChanged("Id");
            }
        }
    }
    public string Name
    {
        get
        {
            return this.name;
        }
        set
        {
            if (this.name != value)
            {
                this.name = value;
                OnPropertyChanged("Name");
            }
        }
    }
    protected virtual void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

WinForms RadPipsPager Bounding

Unbound mode

In unbound mode, the NumberOfPages property determines the amount of pips items that are shown.

this.radPipsPager1.NumberOfPages = 2;

Then, you can handle the SelectedIndexChanged event to get notified when the user changes the selected PipsPagerItem. The SelectedPipChangedEventArgs gives access to the new and old pip.

private void RadPipsPager1_SelectedIndexChanged(object sender, Telerik.WinControls.UI.PipsPager.SelectedPipChangedEvent
{

    this.source.Position = e.NewIndex;
}