Drag and drop nested entries
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=7158
Printed Date: 13 November 2024 at 11:31pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Drag and drop nested entries
Posted By: Nomlas
Subject: Drag and drop nested entries
Date 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
|
Replies:
Posted By: Nomlas
Date 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
|
Posted By: sserge
Date 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
|
|