| | Site Map |
Support
Bits
and Pieces
| Multiple row selection |
This code can be used to provide users with multiple row selection capability within itGrid, using the SHIFT key.
Before using this code, ensure that you have specified:
itGrid.SelectionMode = itSelectListBox
|
Private
m_lRow
As Long
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer Option Explicit Private Sub itGrid1_BeforeUserRowSelect(ByVal Row As Long, ByVal NewSelected As Boolean, Cancel As Boolean ) If Row <> m_lRow And GetKeyStateBool(vbKeyShift) Then Dim
lRow
As Long
' We will update the IsSelected property for other rows based on this row
If
Row > m_lRow
Then
' Cancel the event as we have modified IsSelected programatically
Else
End Sub ' A litle helper function to use with GetKeyState
|