![]() |
Removing Rows? |
Post Reply ![]() |
Author | |
skemp@docucorp ![]() Newbie ![]() Joined: 08 August 2006 Location: United States Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() Posted: 29 August 2006 at 11:45am |
I have a report control on a dialog. I am performing a process on the selected rows and as each is sucessfully done, I want to remove the row and record. Below is the code I am trying but the row still seems to display.
CXTPReportSelectedRows* pSelectedRows = m_wndReport.GetSelectedRows();
POSITION pos = pSelectedRows->GetFirstSelectedRowPosition();
while (pos)
{
CXTPReportRow* pRow = pSelectedRows->GetNextSelectedRow(pos);
CFileInfoRecord *pRecord;
pRecord = (CFileInfoRecord *)pRow->GetRecord();
if (pRecord)
{
if (pRecord->m_pDllInfo)
{
if (pRecord->m_pDllInfo->OnDrop(pRecord->m_pDoc, pRecord->m_localFileH))
{
pSelectedRows->Remove(pRow);
int idx = pRecord->GetIndex();
m_wndReport.GetRecords()->RemoveAt(idx);
m_wndReport.RedrawControl();
}
}
}
} |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Hi,
When you removing records, calling RedrawControl is not enough. In the end of your loop you should call m_wndReport.Populate(); -- WBR, Serge |
|
![]() |
|
dandan ![]() Newbie ![]() ![]() Joined: 05 January 2007 Location: Austria Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
hi, is there also an easy and fast method to remove all rows and columns, to get an empty ReportControl, and fill it again with completely other data?
destroying the object and create it again does for some reason not work in the way as i expected.
|
|
![]() |
|
FSauer ![]() Groupie ![]() ![]() Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
![]() ![]() ![]() ![]() ![]() |
Hi.
Use this to remove all Rows and all Columns:
//CXTPReportControl m_wndReportCtrl;
//Remove all Rows
m_wndReportCtrl.GetRecords()->RemoveAll(); //Remove all Columns
int count = m_wndReportCtrl.GetColumns()->GetCount();
for(int i=0; i < count; i++){
m_wndReportCtrl.GetColumns()->Remove(m_wndReportCtrl.GetColumns()->GetAt(i))
}
m_wndReportCtrl.Populate(); |
|
![]() |
|
dandan ![]() Newbie ![]() ![]() Joined: 05 January 2007 Location: Austria Status: Offline Points: 9 |
![]() ![]() ![]() ![]() ![]() |
thanks a lot! :-)
if everything could be that easy :-)
|
|
![]() |
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 |