# Disabling Segments in .NET MAUI SegmentedControl

The SegmentedControl allows you to disable each of its segments individually. A disabled segment does not respond to user interaction and is excluded from the selection.

The control exposes the following methods for managing the enabled state of a segment:

* `SetSegmentEnabled(int index, bool isEnabled)`—Sets the enabled state of the segment at the specified `index`. The method can be called before the control is loaded; the pending state is applied once the control is attached to the visual tree.
* `IsSegmentEnabled(int index)`—Returns the current enabled state of the segment at the specified `index`.

## Example

The following example shows how to disable a segment.

**1.** Define the SegmentedControl:

```XAML
<telerik:RadSegmentedControl x:Name="segmentControl"
                             VerticalOptions="Start">
    <telerik: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>
    </telerik:RadSegmentedControl.ItemsSource>
</telerik:RadSegmentedControl>
```

**2.** Disable a segment through the `SetSegmentEnabled(int index, bool isEnabled)` method:

```C#
this.segmentControl.SetSegmentEnabled(2, false);
```

The following image shows the end result.

![.NET MAUI SegmentedControl disable segment](https://www.telerik.com/maui-ui/documentation/assets/4f91403089c4680f072d5d2cd7fe28fb/segmentcontrol-disablesegment.png)

> tip For a runnable example demonstrating the SegmentedControl Disable Segment scenario, see the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and go to the **SegmentedControl > Disable Segment** category.

## See Also

* [Data Binding](https://www.telerik.com/maui-ui/documentation/controls/segmentedcontrol/data-binding)
* [Size Mode](https://www.telerik.com/maui-ui/documentation/controls/segmentedcontrol/size-mode)
* [Selection](https://www.telerik.com/maui-ui/documentation/controls/segmentedcontrol/selection)
* [Item Tapped](https://www.telerik.com/maui-ui/documentation/controls/segmentedcontrol/item-tapped)
* [Styling](https://www.telerik.com/maui-ui/documentation/controls/segmentedcontrol/styling)
