Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - DropRecordsEx TargetRecord is wrong in 13.1.0
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

DropRecordsEx TargetRecord is wrong in 13.1.0

 Post Reply Post Reply
Author
Message
John31 View Drop Down
Groupie
Groupie
Avatar

Joined: 08 December 2005
Location: United States
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote John31 Quote  Post ReplyReply Direct Link To This Post Topic: DropRecordsEx TargetRecord is wrong in 13.1.0
    Posted: 10 November 2009 at 3:10pm

In 13.1 the DropRecordsEx event now returns the incorrect TargetRecord when fired.

If the Target Record is a child record the parent record is reported as the target. 

Edit the ReportSample.vbp file in ...\Xtreme SuitePro ActiveX v12.1.1\Samples\ReportControl\VB\ReportSample folder

and

Edit the ReportSample.vbp file in ...\Xtreme SuitePro ActiveX v13.1.0\Samples\ReportControl\VB\ReportSample folder


Replace the Form_Load() event with the following code on the frmDragDrop.frm


Private Sub Form_Load()
    'Adds 3 items to the List Control
    lstItems.AddItem "Item 1"
    lstItems.AddItem "Item 2"
    lstItems.AddItem "Item 3"
   
    'Do not allow columns to be removed from the Report Control
    wndReport.AllowColumnRemove = False
   
    'Add a column named "Items" to the Report Control
    Dim oCol As ReportColumn
    Set oCol = wndReport.Columns.Add(0, "Items", 50, True)
    ' set column as tree
    oCol.TreeColumn = True
    wndReport.PaintManager.TreeIndent = True
   
    Dim str As String, i As Long
   
    'Add 4 records\rows to the Report Control
    For i = 4 To 8
        Dim Record As ReportRecord
        Dim Item As ReportRecordItem
       
        Set Record = wndReport.Records.Add
   
        str = "Item " & CStr(i)
        Set Item = Record.AddItem(str)
       
        ' add child records
        Dim oRec As ReportRecord
        Dim j As Integer
        For j = 1 To 10
            Set oRec = Record.Childs.Add()
            Set Item = oRec.AddItem(str & "-" & CStr(j))
        Next j
        Record.Expanded = True
       
    Next i
   
    'Adds the records the Report Control
    wndReport.Populate
       
    'To enable Drag and Drop in a Report Control the EnableDragDrop method must be used. EnableDragDrop
    'does two things, first it sets a clipboard string that will be used to indicate the type of data
    'that is copied to the clipboard.  Second, it sets the drag and drop effects that are allowed when
    'dragging items to\from the report control.  The available effects are stored in the XTPReportDragDrop
    'enumeration.  If dragging items to\from one or more Report Control's, the same clipboard string must
    'be used for all Report Control's when calling EnableDragDrop.
    '
    'Below, the clipboard string is "ReportSample:frmDragDrop" and we are allowing all drag and drop operations
    cfRecords = wndReport.EnableDragDrop("ReportSample:frmDragDrop", xtpReportAllowDrag Or xtpReportAllowDrop)
End Sub


Now add the wndReport_DropRecordsEx Event as shown below

Private Sub wndReport_DropRecordsEx(ByVal TargetRecord As XtremeReportControl.IReportRecord, ByVal Records As XtremeReportControl.IReportRecords, ByVal Above As Boolean)
  Debug.Print "wndReport_DropRecordsEx TargetRecord.Item(0).Value=" & TargetRecord.Item(0).Value & ", Above=" & Above
End Sub


1) Run the programs
2) Click Additional Samples from the menu
3) Select Drag and Drop Test
4) Drag a child item and drop on another child item

In the 12.1.1 version the child item is reported as the target.

In the 13.1.0 version the parent of the child item is reported as a target item.

 

Regards

John Layton
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 12 November 2009 at 7:56pm
Use https://forum.codejock.com/uploads/BetaOCX/ReportControlBeta13-2.rar 
and apply settings ReportControl.UnrestrictedDragDrop = True
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.125 seconds.