SelectedItem Property
- Namespace
TXTextControl.Windows. Forms. Ribbon
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesWindows. Forms. dll
Description
Gets or sets 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 . Setting null or a string that is not part of the RibbonListViewItemDropDown.Items string array deselects the current selected drop-down item. If the RibbonListViewItemDropDown.ShowText property is set to true, setting this property updates the RibbonListViewItemDropDown.Text property with the same value. The default value is null.
Syntax
public string SelectedItem { get; set; }Public Property SelectedItem As StringExamples
The following example uses RibbonListViewItemDropDown.SelectedItem to configure selected item as part of the ribbon list view item drop down workflow. The configured value is checked before the workflow continues.
ribbonListViewItemDropDown.SelectedItem = "Quarterly report";
if (!string.IsNullOrWhiteSpace(ribbonListViewItemDropDown.SelectedItem))
{
Console.WriteLine($"Selected Item: {ribbonListViewItemDropDown.SelectedItem}");
}ribbonListViewItemDropDown.SelectedItem = "Quarterly report"
If Not String.IsNullOrWhiteSpace(ribbonListViewItemDropDown.SelectedItem) Then
Console.WriteLine($"Selected Item: {ribbonListViewItemDropDown.SelectedItem}")
End If