CXTPReportControl RedrawControl() vs. Populate() |
Post Reply |
Author | |
lajbr
Newbie Joined: 20 April 2005 Location: Czech Republic Status: Offline Points: 12 |
Post Options
Thanks(0)
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 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 each time an item is added. Once you have completed the task of adding items to the control, call the EndUpdate method to enable the CXTPReportControl to repaint. This way of adding items can prevent flickered drawing of the 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 |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |