Need help repostioning records |
Post Reply |
Author | |
ChaosM
Newbie Joined: 26 November 2007 Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: 31 January 2008 at 11:19am |
Hello,
I would like to add the ability to move a selected record up or down in the report control. The docs say that "InsertAt" will move the record where I want, however it's only creating a copy of the record and placing it in the new location. Also, both the original record and the copied record have the same record.index value. I am using the first column as a treeview and there are children.
I have tried both of the following with the same results
Case ID_MOVEUP
Set Record = rc.SelectedRows(0).Record NewIndex = Record.Index - 1 rc.Records.InsertAt NewIndex, Record rc.Populate Case ID_MOVEUP
rc.Records.InsertAt _ rc.SelectedRows(0).Record.Index - 1, _
rc.SelectedRows(0).Record rc.Populate Is this the better way? Is there an example?
Thank you!
|
|
ChaosM
Newbie Joined: 26 November 2007 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Actually i got it to work by removing the old record first. Not sure if this is the intended design.
Case ID_MOVEUP
Set Record = rc.SelectedRows(0).Record NewIndex = Record.Index - 1 rc.Records.RemoveAt Record.Index rc.Records.InsertAt NewIndex, Record rc.Populate Case ID_MOVEDOWN
Set Record = rc.SelectedRows(0).Record NewIndex = Record.Index + 1 rc.Records.RemoveAt Record.Index rc.Records.InsertAt NewIndex, Record rc.Populate Still interested in knowing if why InsertAt didnt just move the record just by passing the new record.index.
Thanks
|
|
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 |