Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Problem on adding child row with editing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Problem on adding child row with editing

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

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Problem on adding child row with editing
    Posted: 22 April 2011 at 7:51am
Hi;

I use this code to add a new record to a parent record and immediately start editing this item (emulating windows explorer "add new folder" command).
    CTreePaneRecord* Record=reinterpret_cast<CTreePaneRecord*>(Report_.GetFocusedRow()->GetRecord());
    CXTPReportRecord* NewRecord=Record->GetChilds()->Add(new CTreePaneRecord(RecordTypeArticleGroup, -1, L"Neue Artikelgruppe"));
    Report_.Populate();
    CXTPReportRow* NewRow=Report_.GetRows()->FindInTree(NewRecord);
    if (NewRow!=0) {
        Report_.SetFocusedRow(TRUE, NewRow, FALSE, FALSE);
        XTP_REPORTRECORDITEM_ARGS itemArgs(&Report_, NewRow, Report_.GetColumns()->GetAt(0));
        Report_.EditItem(&itemArgs);
    }

When the parent row is expanded everything works fine, but in collapsed state nothing happens (XTP_NM_REPORT_EDIT_CANCELED is called immediately).

Whats the right sequence to solve this?
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2011 at 8:01am
Hi;

Forget it; just found
Report_.GetFocusedRow()->SetExpanded()
Martin

Product: Xtreme Toolkit v 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
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.141 seconds.