Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - How to delete a report row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to delete a report row

 Post Reply Post Reply
Author
Message
garylyb View Drop Down
Newbie
Newbie


Joined: 23 August 2006
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote garylyb Quote  Post ReplyReply Direct Link To This Post Topic: How to delete a report row
    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?


Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 15 April 2008 at 4:39am
RedrawControl() is not enough. You must recall 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.219 seconds.