Hello CJ Team,
Deleting selected record from the virtual mode should decrease record count. Please go through following sample code
int count =GetReportCtrl().GetRecords()->GetCount();
//eg. count is 100
//Selected 10 records and delete them. Expected count should be 90
CXTPReportSelectedRows* pSelectedRows = GetReportCtrl().GetSelectedRows();
if(!pSelectedRows)
return;
int nRow = pSelectedRows->GetCount() - 1;
if(nRow < 0)
return;
CWaitCursor wc;
CXTPReportRow* pFocusedRow = pSelectedRows->GetAt(pSelectedRows->GetCount() - 1);
pFocusedRow = GetRows()->GetAt(pFocusedRow->GetIndex() + 1);
while(nRow >= 0)
{
CXTPReportRecord* pRecord = pSelectedRows->GetAt(nRow--)->GetRecord();
if(pRecord)
GetReportCtrl().RemoveRecordEx(pRecord);
if(nRow >= pSelectedRows->GetCount())
nRow = pSelectedRows->GetCount() - 1;
}
GetReportCtrl().SetFocusedRow(pFocusedRow ? pFocusedRow : GetReportCtrl().GetFocusedRow());
count =GetReportCtrl().GetRecords()->GetCount();
//Actual count still 100
Problem when it comes in the GetItemMetrics(..) and trying to fetch the records which are already deleted (Records from 90 to 100).
Waiting for reply.
-Mak