Print Page | Close Window

HOWTO: Move rows up/down by code

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=18416
Printed Date: 29 August 2025 at 7:47pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: HOWTO: Move rows up/down by code
Posted By: mgampi
Subject: HOWTO: Move rows up/down by code
Date Posted: 20 May 2011 at 6:59pm
Hi;

I've a tree like report control and since built-in drag&drop does not support to rearrange rows in this mode, I want to move record up/down by code.
But I can't find out how this has to be implemented.
I tried this code to move a row up by one row:
    CXTPReportRow* Row=Report_.GetFocusedRow();
    Report_.GetRecords()->MoveRecord(Row->GetIndex()-1, Row->GetRecord(), TRUE);
    Report_.Populate();

but nothing happens.

Any help is very welcome...


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: mgampi
Date Posted: 24 May 2011 at 3:44pm
Hi;

Can't believe that no one else needed this before!



-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: olebed
Date Posted: 29 June 2015 at 4:10pm
CXTPReportRow* Row=Report_.GetFocusedRow();
Report_.GetRecords()->MoveRecord(Row->GetRecord()->GetIndex()-1, Row->GetRecord(), TRUE);
Report_.Populate();
 



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