Print Page | Close Window

SOLVED: UnrestrictedDragDrop & RecordsDropped

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=16324
Printed Date: 06 May 2024 at 6:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: UnrestrictedDragDrop & RecordsDropped
Posted By: McKloony
Subject: SOLVED: UnrestrictedDragDrop & RecordsDropped
Date Posted: 02 March 2010 at 2:49am
If the RC is UnrestrictedDragDrop = True and you drop a record not among a sibling child records, it comes to an error message if you want to read TargetRecord properties. So how I can find out, if a user dops  among a sibling child records or not?


-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6



Replies:
Posted By: McKloony
Date Posted: 02 March 2010 at 9:25am
It seems to be a Bug in 13.3.0 the UnrestrictedDragDrop takes no different if it is True or False. It is alwas True!

-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: SuperMario
Date Posted: 02 March 2010 at 2:13pm
UnrestrictedDragDrop is set by you to True or False.  Default is False.

After looking through the source:

ReportControl.UnrestrictedDragDrop = False
If the Target Record is a child record the parent record will be reported as the target. 

ReportControl.UnrestrictedDragDrop = True
If the Target Record is a child record the child record will be reported as the target.  Since it is a child record you will need to support in your app the specific actions to take with the child record.


Posted By: McKloony
Date Posted: 03 March 2010 at 1:30am
Originally posted by SuperMario SuperMario wrote:

UnrestrictedDragDrop is set by you to True or False.  Default is False.
ReportControl.UnrestrictedDragDrop = False
If the Target Record is a child record the parent record will be reported as the target.  
 
If ReportControl.UnrestrictedDragDrop = False there is an error message if I try to read the read TargetRecord properties !!!


-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: SuperMario
Date Posted: 03 March 2010 at 9:50am
Do you use OLEDragDrop?


Posted By: McKloony
Date Posted: 03 March 2010 at 10:31am

Yes, the RC has also OLEDragDrop set to true!



-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: SuperMario
Date Posted: 03 March 2010 at 12:45pm
Can I see code you use to check to check it?


Posted By: McKloony
Date Posted: 04 March 2010 at 12:31am
Originally posted by SuperMario SuperMario wrote:

Can I see code you use to check to check it?
 
Sure ! http://forum.codejock.com/uploads/20100304_003117__Testproject.rar - uploads/20100304_003117__Testproject.rar
 


-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

Language: Visual Basic 6.0 SP6


Posted By: SuperMario
Date Posted: 04 March 2010 at 12:04pm
I think maybe you don't understand what this property is used for.  In your sample UnrestrictedDragDrop will do nothing as the records don't have any child records.  In the sample the Group Rows have child rows, but the records attached to these rows do not have children.

And of course TargetRecord will be Nothing if you don't drop over a row.  You just have to test for it.

Here is one way to see if the record you dropped was dropped in the group it will appear.

Hope this helps

Private Sub repCont5_DropRecordsEx(ByVal TargetRecord As XtremeReportControl.IReportRecord, ByVal Records As XtremeReportControl.IReportRecords, ByVal Above As Boolean)
    If Not TargetRecord Is Nothing Then
    Dim tRecord As XtremeReportControl.ReportRecord
        Debug.Print TargetRecord(2).Value
       
        For Each tRecord In Records
            If TargetRecord(4).GroupCaption = "" Then
                If TargetRecord(4).Caption = tRecord(4).Caption Then
                    Debug.Print "5 - Sibling! : " + TargetRecord(2).Value + " - " + TargetRecord(4).Caption
                    MsgBox "5 - Sibling! : " + TargetRecord(2).Value + " - " + TargetRecord(4).Caption
                    Exit Sub
                End If
            Else
                If TargetRecord(4).GroupCaption = tRecord(4).GroupCaption Then
                    Debug.Print "5 - Sibling! : " + TargetRecord(2).Value + " - " + TargetRecord(4).Caption
                    Debug.Print "5 - Sibling! : " + TargetRecord(2).Value + " - " + TargetRecord(4).Caption
                    Exit Sub
                End If
            End If
        Next
       
        MsgBox "5- NO SIBLINGS! " + TargetRecord(2).Value + " - " + TargetRecord(4).Caption
    Else
        MsgBox "repCont5_DropRecordsEx NOT DROPPED AMONG ROWS!"
    End If
End Sub


Posted By: SuperMario
Date Posted: 09 March 2010 at 10:34am
Did that help?


Posted By: McKloony
Date Posted: 09 March 2010 at 11:11am
Yes, it's solved! Thanks.

-------------
Product: Xtreme SuitePro (ActiveX) 16.2.5

Platform: XP / Windows 7

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