Hekktor
2019-06-05T17:24:09Z
Im new usuing the igrid control and i caont find a example how to list or pass to array a list of selected cells, and... it is possible to select cells only in the same row at time ?
thanks!
Igor/10Tec
2019-06-06T14:28:47Z
Originally Posted by: Hekktor 

i caont find a example how to list or pass to array a list of selected cells



You can retrieve the collection of currently selected cells with the iGrid.SelectedCells property. Items of this collection can be accessed like items in an array - iGrid.SelectedCells[0], iGrid.SelectedCells[1] and so on.


Originally Posted by: Hekktor 

it is possible to select cells only in the same row at time ?



Below is a VB.NET example of how to limit the interactive selection by cells in one row:

' Set the cursor clip rectangle when the mouse button is pressed in a cell
Private Sub iGrid1_CellMouseDown(sender As Object, e As iGCellMouseDownEventArgs) Handles iGrid1.CellMouseDown
    Dim rcCellBounds As Rectangle = DirectCast(sender, iGrid).RectangleToScreen(e.Bounds)

    Dim rcScreenBounds As Rectangle = Screen.FromControl(Me).Bounds

    Cursor.Clip = New Rectangle(rcScreenBounds.X, rcCellBounds.Y, rcScreenBounds.Width, rcCellBounds.Height - 1)
End Sub

' Clear the cursor clip rectangle when the mous ebutton is released.
' Pay attention to the fact that we do this in iGrid's MouseUp event but not CellMouseUp:
' CellMouseUp is not triggered if the mouse pointer was released outside of the bounds of
' the cell in which the mouse button was pressed.
Private Sub iGrid1_MouseUp(sender As Object, e As MouseEventArgs) Handles iGrid1.MouseUp
    Cursor.Clip = Rectangle.Empty
End Sub