Version

CheckedItem Property (UltraExplorerBar)

Return or sets the UltraExplorerBarItem that is currently checked, or null if no Item is currently checked.
Syntax
'Declaration
 
Public Property CheckedItem As UltraExplorerBarItem
public UltraExplorerBarItem CheckedItem {get; set;}
Remarks

If the control’s StateButtonCheckStyle property is ‘0 – Exclusive Within Control’, this property returns the UltraExplorerBarItem in the control that is currently checked (if any).

If the control’s StateButtonCheckStyle property is ‘1 – Exclusive Within Group’, this property returns the checked item (if any) within the current ActiveGroup. If the ActiveGroup is null (Nothing in VB), and the ActiveItem is non-null, the Group containing the ActiveItem is used.

Note: in order for an Item to be checked its Style property must resolve to ‘1 – StateButton’.

Note: the control’s StateButtonCheckStyle property determines how the control enforces mutual exclusivity among all Items with Style ‘1 – StateButton’.

Example
The following code demonstrates how to use the properties that relate to state button type items.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar

	Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button4.Click

		' If there is no checked item, set the StateButtonCheckStyle to 'ExclusiveWithinControl'
		' and check the first state button type item we find.
		If (Me.ultraExplorerBar1.CheckedItem Is Nothing) Then
			Me.ultraExplorerBar1.StateButtonCheckStyle = StateButtonCheckStyle.ExclusiveWithinControl


			' Iterate thru all Groups and Items and check the first StateButton type Item we find
			Dim group As UltraExplorerBarGroup
			For Each group In Me.ultraExplorerBar1.Groups

				Dim item As UltraExplorerBarItem
				For Each item In group.Items
					If item.SettingsResolved.Style = ItemStyle.StateButton Then
						item.Checked = True

						Exit For
					End If
				Next

				' If we set a CheckedItem above, exit our Group loop.
				If (Not Me.ultraExplorerBar1.CheckedItem Is Nothing) Then
					Exit For
				End If
			Next
		End If

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinExplorerBar;

		private void button4_Click(object sender, System.EventArgs e)
		{
			// If there is no checked item, set the StateButtonCheckStyle to 'ExclusiveWithinControl'
			// and check the first state button type item we find.
			if (this.ultraExplorerBar1.CheckedItem == null)
			{
				this.ultraExplorerBar1.StateButtonCheckStyle = StateButtonCheckStyle.ExclusiveWithinControl;


				// Iterate thru all Groups and Items and check the first StateButton type Item we find
				foreach(UltraExplorerBarGroup group in this.ultraExplorerBar1.Groups)
				{
					foreach(UltraExplorerBarItem item in group.Items)
					{
						if (item.SettingsResolved.Style == ItemStyle.StateButton)
						{
							item.Checked = true;

							break;
						}
					}

					// If we set a CheckedItem above, exit our Group loop.
					if (this.ultraExplorerBar1.CheckedItem != null)
						break;
				}
			}
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also