Version

Item(Int32) Property

Returns the UltraGridRow at the specified ordinal position within this collection.
Syntax
'Declaration
 
Public Overloads ReadOnly Property Item( _
   ByVal index As Integer _
) As UltraGridRow
public UltraGridRow Item( 
   int index
) {get;}

Parameters

index
The ordinal position of the row within this collection.
Remarks

The elements of this collection can be indexed by their associated "data values", i.e., the value of the cell that intersects with the column referenced by the ValueMember property. If the value is of type integer, however, the integer must be boxed into a variable of type object in order to access that indexer overload; passing an integer directly will cause execution to route through this overload, and the parameter value will be interpreted as an index, not a data value.

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

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

    Public Function IsItemChecked(ByVal combo As UltraCombo, ByVal dataValue As Object) As Boolean

        Dim checkedRows As CheckedRowsCollection = combo.CheckedRows

        Dim valueColumn As UltraGridColumn = IIf(combo.DisplayLayout.Bands(0).Columns.Exists(combo.ValueMemberResolved), combo.DisplayLayout.Bands(0).Columns(combo.ValueMemberResolved), Nothing)
        If valueColumn Is Nothing Then Return False

        '  Iterate the CheckedRows collection and compare the value
        '  of each row therein to the specified value.
        Dim row As UltraGridRow
        For Each row In checkedRows

            Dim cellValue As Object = row.Cells(valueColumn).Value

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

        Return False

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

public bool IsItemChecked( UltraCombo combo, object dataValue )
{
    CheckedRowsCollection checkedRows = combo.CheckedRows;
    
    UltraGridColumn valueColumn = combo.DisplayLayout.Bands[0].Columns.Exists( combo.ValueMemberResolved ) ? combo.DisplayLayout.Bands[0].Columns[combo.ValueMemberResolved] : null;
    if ( valueColumn == null )
        return false;

    //  Iterate the CheckedRows collection and compare the value
    //  of each row therein to the specified value.
    foreach( UltraGridRow row in checkedRows )
    {
        object cellValue = row.Cells[valueColumn].Value;

        if ( object.Equals(dataValue, cellValue) )
            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