Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Virtual Report Control and MoveFirstRow
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Virtual Report Control and MoveFirstRow

 Post Reply Post Reply
Author
Message
Danlar View Drop Down
Groupie
Groupie
Avatar

Joined: 27 February 2008
Location: United States
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Danlar Quote  Post ReplyReply Direct Link To This Post Topic: Virtual Report Control and MoveFirstRow
    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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2009 at 3:43pm
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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 20 October 2009 at 9:54pm
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.137 seconds.