Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] SelectionChanged don't fires sometimes!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] SelectionChanged don't fires sometimes!

 Post Reply Post Reply
Author
Message
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] SelectionChanged don't fires sometimes!
    Posted: 12 March 2011 at 3:32pm
Hello CJ-Team,

the "SelectionChanged" Event doesn't fires, if some records are invisible! Ouch

Please see the attached sample-code for a better understanding.

  >>> uploads/1570/ReportControl_SelectAll_Bug.zip

Please, is there a workaround or fix available - or do I something wrong?


Back to Top
Peter59 View Drop Down
Groupie
Groupie


Joined: 19 July 2007
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote Peter59 Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2011 at 1:43am
Hi Jebo,

I'm not from the CJ-Team Wink but I can confirm your observation.

A possible workaround could be to select all visible rows manually:
Private Sub ReportControl1_PreviewKeyDown(KeyCode As Integer, ByVal Shift As Integer, Cancel As Boolean)
    Select Case KeyCode
    Case vbKeyA
        If Shift And vbCtrlMask Then
            '-- select rows manually
            ReportControl1.Navigator.MoveFirstRow
            ReportControl1.Navigator.MoveLastRow True
        End If
    End Select
End Sub

This works for me, see attached sample. uploads/3156/SelectionChanged_problem.zip

Peter

Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows 7 64 Bit
Language: Visual Basic 6.0 SP6
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2011 at 3:17am
Hi,
 
Fix: Don't know, guess you have to submit ticket Wink
 
Workaround: Add a dummy record at the end and make sure this record is visible at all times.
 
In your case:
 
Private Sub ReportControl1_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)
If ReportControl1.Navigator.CurrentFocusInHeadersRows Then
    Dim Rec As ReportRecord, sTmp As String, c As Long, R As Long
   
    sTmp = ReportControl1.HeaderRecords(0).Item(1).Value
      
    If sTmp <> "" Then
        For R = 0 To ReportControl1.Records.Count - 1
            Set Rec = ReportControl1.Records(R)
            Rec.Visible = InStr(1, Rec.Item(1).Caption, sTmp, vbTextCompare)
        Next
      Else  ' Make all records visible
        For R = 0 To ReportControl1.Records.Count - 1
            ReportControl1.Records(R).Visible = True
        Next
    End If
End If
Me.ReportControl1.Records(Me.ReportControl1.Records.Count - 1).Visible = True
ReportControl1.Populate: ReportControl1_SelectionChanged
End Sub
 
 
The thing is that RC scrolls to last record when selecting all records with CTRL-A but if only AAA is visible last record with FFF isn't visible anymore. That's why you need a 'last' record that is always visible.
 
 
 
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....
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2011 at 5:27am
Thank you guys! Hug

Have opened a ticket and will try your workarounds.
[Sig removed by Admin: Signature can't exceed 40GB]
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2011 at 2:13pm
Originally posted by Peter59 Peter59 wrote:

Hi Jebo,
This works for me, see attached sample. uploads/3156/SelectionChanged_problem.zip
Peter

Sorry Peter, but this workaround doesn't work if the rows are grouped!

I hope CJ will fix this bug with v15.0.3.

[Sig removed by Admin: Signature can't exceed 40GB]
Back to Top
Peter59 View Drop Down
Groupie
Groupie


Joined: 19 July 2007
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote Peter59 Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2011 at 2:42pm
Doing it manually - second attempt!

Hi Jebo,

with a little modification, CTRL+A will select all rows even when they are grouped:
Private Sub ReportControl1_PreviewKeyDown(KeyCode As Integer, ByVal Shift As Integer, Cancel As Boolean)

    Dim rptRow As XtremeReportControl.ReportRow

    Select Case KeyCode
    Case vbKeyA
        If Shift And vbCtrlMask Then
            '-- select rows manually
            For Each rptRow In ReportControl1.Rows
                If Not rptRow.GroupRow Then rptRow.Selected = True
            Next
        End If
        ReportControl1_SelectionChanged
    End Select
End Sub

See attached sample. uploads/3156/SelectionChanged_problem2.zip

Peter


Product: Xtreme SuitePro (ActiveX) version 15.2.1
Platform: Windows 7 64 Bit
Language: Visual Basic 6.0 SP6
Back to Top
Jebo View Drop Down
Senior Member
Senior Member


Joined: 27 October 2005
Location: Germany
Status: Offline
Points: 318
Post Options Post Options   Thanks (0) Thanks(0)   Quote Jebo Quote  Post ReplyReply Direct Link To This Post Posted: 13 March 2011 at 3:19pm
Hi Peter,

thanks!

I go this way:

            RecordsSelCount = 0
            For Each Row In RepCtrl.SelectedRows
                RecordsSelCount = RecordsSelCount + 1
            Next
msgbox RecordsSelCount

BUT your and my workaround is really slow!
So I hope CJ will fix the SelRow-Counter!
[Sig removed by Admin: Signature can't exceed 40GB]
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 14 March 2011 at 10:38pm
Hi,

I can confirm that this is a bug in 15.0.2. I'll fix it for 15.0.3 tomorrow. As a workaround the following code should work:

Private Sub ReportControl1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyA And Shift = 2 Then
        ReportControl1_SelectionChanged
    End If
End Sub

Andre

Codejock support
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.