Print Page | Close Window

Move a Row

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=10070
Printed Date: 10 November 2024 at 7:37am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Move a Row
Posted By: braian87b
Subject: Move a Row
Date Posted: 03 April 2008 at 7:04pm
Please, i need to know how to move programatically a row/record to another index, for the classic buttons "Move Up" "Move Down" than moves the current focused row/record swapping places with the previus or next near.
 
Thanks for advance.!



Replies:
Posted By: Aaron
Date Posted: 21 April 2008 at 4:49am
Hi,
 
I think you have to do this yourself. Using InsertAt and RemoveAt methods allow you to "move" the records.
 
Down:
 
wndReportControl.Records.RemoveAt wndReportControl.FocusedRow.Index
    wndReportControl.Records.InsertAt wndReportControl.FocusedRow.Index + 1, wndReportControl.FocusedRow.Record
 
wndReportControl.Populate

Up:
 
wndReportControl.Records.RemoveAt wndReportControl.FocusedRow.Index
    wndReportControl.Records.InsertAt wndReportControl.FocusedRow.Index - 1, wndReportControl.FocusedRow.Record
wndReportControl.Populate
 
Note: this doesn't work with sorting
 
 


Posted By: braian87b
Date Posted: 24 April 2008 at 12:26pm
thank you, but seems i dont have that method in my control
 I have 10.1 version
 
where i can download another more newer version lite, or demo, whenever.
 
 
Thanks in advance


Posted By: SuperMario
Date Posted: 24 April 2008 at 1:06pm
http://www.codejock.com/downloads/


Posted By: braian87b
Date Posted: 24 April 2008 at 1:17pm
Thanks!, im downloading the files rigth now.
 
 
 


Posted By: braian87b
Date Posted: 25 April 2008 at 1:46pm
Originally posted by Aaron Aaron wrote:

Hi,
 
I think you have to do this yourself. Using InsertAt and RemoveAt methods allow you to "move" the records.
 
Down:
 
wndReportControl.Records.RemoveAt wndReportControl.FocusedRow.Index
    wndReportControl.Records.InsertAt wndReportControl.FocusedRow.Index + 1, wndReportControl.FocusedRow.Record
 
wndReportControl.Populate

Up:
 
wndReportControl.Records.RemoveAt wndReportControl.FocusedRow.Index
    wndReportControl.Records.InsertAt wndReportControl.FocusedRow.Index - 1, wndReportControl.FocusedRow.Record
wndReportControl.Populate
 
Note: this doesn't work with sorting
 
 
Question: Can this be done in some way with the v10.1 version of the ReportControl ?


Posted By: Aaron
Date Posted: 26 April 2008 at 9:22am
Hi,
 
I don't know the properties/methods of V10.1 so I don't know if its possible or not. What I posted before is just a workaround and possible with V11.2 (thats also the only version I know)
 
Maybe there is someone who did the same and with your version.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net