Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Hekktor  
#1 Posted : Wednesday, June 5, 2019 6:24:09 PM(UTC)
Hekktor

Rank: Newbie

Groups: Registered
Joined: 6/5/2019(UTC)
Posts: 1

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  
#2 Posted : Thursday, June 6, 2019 3:28:47 PM(UTC)
Igor/10Tec

Rank: Administration

Groups: Administrators, Forum Moderator
Joined: 1/17/2011(UTC)
Posts: 1,111

Thanks: 15 times
Was thanked: 141 time(s) in 141 post(s)
Originally Posted by: Hekktor Go to Quoted Post
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 Go to Quoted Post
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:

Code:
' 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
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.