Drag and drop nested entries |
Post Reply |
Author | |
Nomlas
Newbie Joined: 15 December 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
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 |
|
Nomlas
Newbie Joined: 15 December 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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 |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |