Print Page | Close Window

CXTPReportControl RedrawControl() vs. Populate()

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=7099
Printed Date: 09 May 2024 at 6:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPReportControl RedrawControl() vs. Populate()
Posted By: lajbr
Subject: CXTPReportControl RedrawControl() vs. Populate()
Date Posted: 10 May 2007 at 5:28am
Hi,

I have a problem with CXTPReportControl in CodeJock 10.4.2. I use CXTPReportControl and I use it to representation of e-mail folder. In so case I need to add and remove items/e-mails very often. I supposed that I have to use only Populate() to propagate the changes. But I have found that there is CXTPReportControl::RedrawControl() too and that should be possible to use it in combination with BeginUpdate() and EndUpdate() in this situation. So I wrote a method where I added one item enwrap with BeginUpdate()  and EndUpdate(), where CReportEmailView is class based on CXTPReportView:

void CReportEmailView::AddTestItem(MAILCONTEXT pNewCtx)
{
GetReportCtrl().BeginUpdate();
lRet = AddContextItem(pNewCtx);
if(!lRet)
    RedrawControl();
GetReportCtrl().EndUpdate();
}

int CReportEmailView::AddContextItem
(MAILCONTEXT pNewCtx)
{
... // getting parameters
//add new record
CXTPReportRecord *pRecord = AddRecord(...parameters...);

    return 0;
}

I supposed that it will work because there is written: "If you want to add items one at a time using the CXTPReportControl__AddRecord@CXTPReportRecord_.html - AddRecord method, or to make some another operations in a single sequence, you can use the BeginUpdate method to prevent the control from repainting the CXTPReportControl.html - CXTPReportControl each time an item is added. Once you have completed the task of adding items to the control, call the CXTPReportControl__EndUpdate.html - EndUpdate method to enable the CXTPReportControl.html - CXTPReportControl to repaint. This way of adding items can prevent flickered drawing of the CXTPReportControl.html - CXTPReportControl when a large number of items are being added to the control." in the help file. But it doesn't work. I don't know why the change isn't propagate to the output even if the new record is successfully added to the control and RedrawControl() is called from the EndUpdate(). Please, can you help me where the problem is or is it neccessary to use only Populate() for ensure correct state of CXTPReportControl?

Thanks you beforehand for your suggestions and answers.

Lajbr



Replies:
Posted By: sserge
Date Posted: 10 May 2007 at 4:57pm
Hi,

After modifying a Records collection you have to call Populate, because this method actually clears all current rows, prepare Records to be shown (performs grouping, sorting, filtering and others) and then populates an array of Rows which is actually visible for a user.

Hope described this better then in help files...

--
WBR,
Serge



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