Print Page | Close Window

Virtual Report Control and MoveFirstRow

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=15403
Printed Date: 29 September 2024 at 3:35pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Virtual Report Control and MoveFirstRow
Posted By: Danlar
Subject: Virtual Report Control and MoveFirstRow
Date 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



Replies:
Posted By: mdoubson
Date 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


-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date 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 - https://forum.codejock.com/uploads/DemoVersion/ReportControlMFCUpdated.rar  but other code is up to date to build dll


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net