Virtual Report Control and MoveFirstRow |
Post Reply |
Author | |
Danlar
Groupie Joined: 27 February 2008 Location: United States Status: Offline Points: 12 |
Post Options
Thanks(0)
Posted: 20 October 2009 at 1:51pm |
We're having trouble using CXTPReportNavigator::MoveFirstRow with a report control in virtual mode.
In MoveFirstRow (and MoveLastRow), you immediately check first to see if the currently focused row is already the first (or last) row. It looks like a virtual report control always returns the same virtual row object, and so when you compare the address between the result of GetAt(0) and the focused row, they are always the same. Is this a bug, or is there some other method I use for selecting the First (or Last) row in the report? _Dan PS We're using version 13.1.0 |
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Sure it does not works in virtualmode - but you can use PageUp - PageDown navigation.
Need to add special virtual mode navigation for cases: VK_HOME and VK_END
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
Please try this code - I can't SVN it until 13.2 will be official released but you can build your own dll now and test your case:
void CXTPReportNavigator::MoveFirstRow(BOOL bShiftKey, BOOL bControlKey) { if (!m_pReportControl) return; if (m_pReportControl->IsMultiSelectionMode()) bControlKey = TRUE;CXTPReportRow* pFirst = m_pReportControl->m_pRows->GetAt(0); if (m_pReportControl->IsVirtualMode()) m_pReportControl->SetFocusedRow(pFirst, bShiftKey, bControlKey); else if (pFirst != m_pReportControl->GetFocusedRow()) m_pReportControl->SetFocusedRow(pFirst, bShiftKey, bControlKey);m_pReportControl->UnselectGroupRows(); } void CXTPReportNavigator::MoveLastRow(BOOL bShiftKey, BOOL bControlKey) { if (!m_pReportControl) return; if (m_pReportControl->IsMultiSelectionMode()) bControlKey = TRUE;CXTPReportRow* pLast = m_pReportControl->m_pRows->GetAt(m_pReportControl->m_pRows->GetCount() - 1); if (m_pReportControl->IsVirtualMode()) m_pReportControl->SetFocusedRow(pLast, bShiftKey, bControlKey); else if (pLast != m_pReportControl->GetFocusedRow()) m_pReportControl->SetFocusedRow(pLast, bShiftKey, bControlKey);m_pReportControl->UnselectGroupRows(); } I don't put this piece in https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar but other code is up to date to build dll |
|
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 |