Version

Item(Object) Property

Returns the ValueListItem whose DataValue is equal to the specified dataValue, or null if no item's value matches.
Syntax
'Declaration
 
Public Overloads ReadOnly Property Item( _
   ByVal dataValue As Object _
) As ValueListItem
public ValueListItem Item( 
   object dataValue
) {get;}

Parameters

dataValue
The DataValue of the ValueListItem to return, or null if no item with the specified dataValue exists.
Remarks

This indexer provides a way to access an item by its DataValue. A standard indexer is also exposed, the 'index' parameter of which is implied to be the ordinal position of the item within this collection. Use that overload when that index is already available.

Example
The following code sample demonstrates how to use the CheckedItems collection to determine whether an item with a particular value is checked:

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinEditors
Imports System.Diagnostics

	Public Function IsItemChecked(ByVal comboEditor As UltraComboEditor, ByVal dataValue As Object) As Boolean

        Dim checkedItems As CheckedValueListItemsCollection = comboEditor.CheckedItems

        '  Iterate the CheckedItems collection and compare the value
        '  of each item therein to the specified value.
        Dim item As ValueListItem
        For Each item In checkedItems

            If Object.Equals(dataValue, item.DataValue) Then Return True
        Next

        Return False

	End Function
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
using System.Diagnostics;

public bool IsItemChecked( UltraComboEditor comboEditor, object dataValue )
{
    CheckedValueListItemsCollection checkedItems = comboEditor.CheckedItems;

    //  Iterate the CheckedItems collection and compare the value
    //  of each item therein to the specified value.
    foreach( ValueListItem item in checkedItems )
    {
        if ( object.Equals(dataValue, item.DataValue) )
            return true;
    }

    return false;
}
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