Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - HOWTO: Move rows up/down by code
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Move rows up/down by code

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1206
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Move rows up/down by code
    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
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1206
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Senior Member
Senior Member


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 29 June 2015 at 4:10pm
CXTPReportRow* Row=Report_.GetFocusedRow();
Report_.GetRecords()->MoveRecord(Row->GetRecord()->GetIndex()-1, Row->GetRecord(), TRUE);
Report_.Populate();
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.