Print Page | Close Window

How to delete a report 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=10209
Printed Date: 22 November 2024 at 11:37pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to delete a report row
Posted By: garylyb
Subject: How to delete a report row
Date Posted: 12 April 2008 at 7:38pm

I have this code to delete any rows that are checked:


    // Now see if any rows need to be deleted

    CXTPReportRows *pRows = m_wndReportCtrl.GetRows();

    for ( int j=0 ; j < pRows->GetCount() ; j++ )
    {
        CXTPReportRow *pRow = pRows->GetAt(j);
        BOOL bChecked = pRow->GetRecord()->GetItem(COLUMN_DELETE)->IsChecked();
        if ( bChecked )
        {
            pRows->RemoveAt(j);
        }
    }

    m_wndReportCtrl.RedrawControl();



It works, but when I click on the header to sort the report, the deleted rows come back, still checked.

How can I get rid of it for good?





Replies:
Posted By: Michl
Date Posted: 15 April 2008 at 4:39am
RedrawControl() is not enough. You must recall 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