Contents
- User interface
- Selected Index through programmatically.
Having trouble getting help?
Contact Support
Contact Support
Notify the selection changes in SfSegmentedControl in Xamarin.Android
13 Feb 20251 minute to read
The segmented control handles the Selection changed when there is a change from one segment item to another. It can be handled by two ways.
User interface
When users navigate from one item to another, selection is changed, so that the SelectedIndex
value is updated to the new index of the item. The segmented control provides the SelectionChanged
event, which is triggered when the selection is changed with the SelectionChangedEventArgs
.
Index
- Gets the current index value of the selected item.
segmentedControl.SelectionChanged += (object sender, SelectionChangedEventArgs e) =>
{
var selectedIndex = e.Index;
};
Selected Index through programmatically.
You can set the default value programmatically for the selection to be placed. The selection gets updated based on the index value given for the SelectedIndex
.
segmentedControl.SelectedIndex = 2;