Print Page | Close Window

[SOLVED] Problem on adding child row with editing

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=18264
Printed Date: 16 November 2024 at 8:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Problem on adding child row with editing
Posted By: mgampi
Subject: [SOLVED] Problem on adding child row with editing
Date 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 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: mgampi
Date Posted: 22 April 2011 at 8:01am
Hi;

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


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

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



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