Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Drag and drop nested entries
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Drag and drop nested entries

 Post Reply Post Reply
Author
Message
Nomlas View Drop Down
Newbie
Newbie


Joined: 15 December 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nomlas Quote  Post ReplyReply Direct Link To This Post Topic: Drag and drop nested entries
    Posted: 16 May 2007 at 2:55pm
Could someone provide a sample of using Drag and Drop for moving nested entries (treeview style)?

In the following screenshot, I can move the "group" items (as in the VB6 sample), but cannot move a detail item between (or within) groups. I guess this isn't supported by the default behavior.

I eventually need to provide the user with a general ability to move, copy, delete, and insert entries at will, so a general example would be great and, I think, a valuable addition to the VB6 samples too.



Thanks
Back to Top
Nomlas View Drop Down
Newbie
Newbie


Joined: 15 December 2006
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nomlas Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2007 at 9:01am
In my attempt to standardize on the Codejock suite, I'm trying to use the report control as a replacement for another grid control I currently use. I'm sure I just don't understand the object model well enough, but have found it difficult to do common actions such as re-arranging the grid.

For example, this code will move an entry to (the end) of another group. Is this the right approach? If so, how can I re-order the Childs collection so the entry stays where I "dropped" it?


Private Sub RC_RecordsDropped(ByVal TargetRecord As XtremeReportControl.IReportRecord, ByVal Records As XtremeReportControl.IReportRecords, ByVal Above As Boolean)
Dim s As String
Dim i As Long
Dim TargetRow As ReportRow
Dim NewRec As ReportRecord
Dim Item As ReportRecordItem
    '--- Find target location
    Set TargetRow = RC.Rows.FindRowInTree(TargetRecord)
    '--- Add a new child record
    Set NewRec = TargetRow.ParentRow.Record.Childs.Add()
    '--- Manually add items (columns)
    NewRec.AddItem Records(0).Item(0).Value
    Set Item = NewRec.AddItem(Records(0).Item(1).Value)
    Item.HasCheckbox = True
    NewRec.AddItem Records(0).Item(2).Value
    '--- Delete original record
    RC.Cut
    RC.Populate
End Sub

Thanks
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2007 at 10:38am
Hi,

I agree with you that this way of implementing such operation doesn't look quite handy. But that's what is only available for now.

You can also use method .Insert to specify an order number.

--
WBR,
Serge
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.250 seconds.