Selection

The RadSegmentedControl control exposes few useful properties which can help you work with the items selection.

Setting the selected segment

The segment control has a SelectedIndex property which you can use to set the selected item.

Setting selection colors

You can define custom colors for the text and the background of the selected segment. You can do that via the the following properties of RadSegmentedControl:

  • SelectedSegmentBackgroundColor
  • SelectedSegmentTextColor

Selection changed

RadSegmentedControl exposes a SelectionChanged event which is fired when the selected item is changed.

Example

This example shows how to set the selection manually.

<telerikInput:RadSegmentedControl x:Name="segmentControl"
                                  HeightRequest="60"
                                  SelectedIndex="2"
                                  VerticalOptions="Start">
    <telerikInput:RadSegmentedControl.ItemsSource>
        <x:Array Type="{x:Type x:String}">
            <x:String>Popular</x:String>
            <x:String>Library</x:String>
            <x:String>Playlists</x:String>
            <x:String>Friends</x:String>
        </x:Array>
    </telerikInput:RadSegmentedControl.ItemsSource>
</telerikInput:RadSegmentedControl>

Figure 1: Selection example

SegmentedControl selection example

See Also