Version

LassoSelectMode Property

Gets/sets whether "lasso" drag selection is supported and if so, which mouse buttons can be used to drag the lasso.
Syntax
'Declaration
 
Public Property LassoSelectMode As LassoSelectMode
public LassoSelectMode LassoSelectMode {get; set;}
Remarks

Lasso selection is disabled for all settings of the SelectionType property except 'Extended'.

When lasso select mode is enabled, the user can select items by pressing either the left or right mouse button (depending on the value of the property) while the cursor is positioned over an area that does not contain a selectable part of an item, and moving the mouse outside the Infragistics.Win.ScaledSystemInformation.GetDragSize(System.Windows.Forms.Control) drag threshold. Once a lasso drag operation has started, the user sees a semi-transparent rectangle whose corners are defined by the point at which the drag operation was initiated and the current cursor position. As the user moves the mouse, the bounds of this rectangle is updated, and any items with which it intersects become selected.

If the user drags the lasso past the bounds of the control's viewable area, the control is automatically scrolled in that direction, so that the selection operation can continue.

Disabled items cannot be selected, and are not included in a lasso selection if the lasso selection rectangle intersects with them.

When the FullRowSelect property is set to true, lasso selection can only be initiated when the MouseDown message is received over the heading area of a group, or the area under the last visible item.

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