Print Page | Close Window

how select rows by drag mouse?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=12357
Printed Date: 14 November 2024 at 5:42pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how select rows by drag mouse?
Posted By: mozaheb
Subject: how select rows by drag mouse?
Date Posted: 07 October 2008 at 6:15am
hi all

help me about how select rows by drag mouse?

thank you




Replies:
Posted By: Aaron
Date Posted: 24 October 2008 at 3:57am
Hi,
 
You can't. Fastest way to select multiple rows is setting property MultipleSelectiom = true and with CTRL / SHIFT key + mouse,  arrow keys, pagedown etc. etc. (just as ordinary listview items)
 
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: jpbro
Date Posted: 24 October 2008 at 5:10pm
You can't do this automatically with a property or method of the ReportControl, but you can code it yourself. Something like this:


Private Sub wndReportControl_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
   Dim lo_Row                                     As ReportRow

   Set lo_Row = wndReportControl.HitTest(x, y).Row
   If Not lo_Row Is Nothing Then
      If Not lo_Row.GroupRow Then
         m_FirstSelection = lo_Row.Index
      End If
   End If
End Sub

Private Sub wndReportControl_MouseMove(Button As Integer, Shift As Integer, x As Long, y As Long)
   Dim lo_Hit                                     As ReportHitTestInfo
   Dim i                                          As Long
   Dim l_Step                                     As Long

   If Button = vbLeftButton Then
      If m_FirstSelection >= 0 Then
         Me.wndReportControl.SelectedRows.DeleteAll
         Set lo_Hit = Me.wndReportControl.HitTest(x, y)
         If Not lo_Hit Is Nothing Then
            If Not lo_Hit.Row Is Nothing Then
               If lo_Hit.Row.Index < m_FirstSelection Then
                  l_Step = -1
               Else
                  l_Step = 1
               End If

               For i = m_FirstSelection To lo_Hit.Row.Index Step l_Step
                  If Not Me.wndReportControl.Rows(i).GroupRow Then
                     Me.wndReportControl.Rows(i).Selected = True
                  End If
               Next i
            End If
         End If
      End If
   End If
End Sub

Private Sub wndReportControl_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long)
   m_FirstSelection = -1
End Sub

Private Sub Form_Load()
    m_FirstSelection = -1
End Sub



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net