# RibbonListView.RibbonListViewItemDropDown.SelectedIndex Property

> Gets or sets the index of the currently selected drop-down item. Setting -1 deselects the current selected drop-down item. If the RibbonListViewItemDropDown.ShowCheckMargin property is set to true, the corresponding item of the drop-down menu is checked when it is opened . If the RibbonListViewItemDropDown.ShowText property is set to true, setting this property updates the RibbonListViewItemDropDown.Text property with the text of the corresponding RibbonListViewItemDropDown.SelectedItem property value. The default value is -1.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 29.0
- **Namespace:** `TXTextControl.Windows.Forms.Ribbon`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl.Windows.Forms.Ribbon > RibbonListView.RibbonListViewItemDropDown.SelectedIndex Property
- **587 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/selectedindex-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/selectedindex-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/selectedindex-property/llms-full.txt

---

### Description

Gets or sets the index of the currently [selected drop-down item](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/selecteditem-property/llms-full.txt). Setting -1 deselects the current selected drop-down item. If the [RibbonListViewItemDropDown.ShowCheckMargin](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/showcheckmargin-property/llms-full.txt) property is set to true, the corresponding item of the drop-down menu is checked when it is opened . If the [RibbonListViewItemDropDown.ShowText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/showtext-property/llms-full.txt) property is set to true, setting this property updates the [RibbonListViewItemDropDown.Text](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/text-property/llms-full.txt) property with the text of the corresponding `RibbonListViewItemDropDown.SelectedItem` property value. The default value is -1.

### Syntax

```csharp
public int SelectedIndex { get; set; }
```

```vbnet
Public Property SelectedIndex As Integer
```

### Examples

The following example uses `RibbonListViewItemDropDown.SelectedIndex` to configure selected index as part of the ribbon list view item drop down workflow. The configured value is checked before the workflow continues.

```csharp
ribbonListViewItemDropDown.SelectedIndex = 1;
Console.WriteLine($"Selected Index used by Ribbon List View Item Drop Down: {ribbonListViewItemDropDown.SelectedIndex}");
```

```vbnet
ribbonListViewItemDropDown.SelectedIndex = 1
Console.WriteLine($"Selected Index used by Ribbon List View Item Drop Down: {ribbonListViewItemDropDown.SelectedIndex}")
```

### Remarks

A `System.IndexOutOfRangeException` is thrown if the set value is less than -1 or larger than or equals to the number of [drop-down items](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/items-property/llms-full.txt).

---

## Nearby

- **Previous:** [RibbonListView.RibbonListViewItemDropDown.MinimumWidth Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/minimumwidth-property/llms-full.txt)
- **Next:** [RibbonListView.RibbonListViewItemDropDown.SelectedItem Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonlistview-ribbonlistviewitemdropdown/selecteditem-property/llms-full.txt)
