![]() |
Selection Change NOTIFY |
Post Reply ![]() |
Author | |
umcbrad ![]() Newbie ![]() Joined: 26 April 2005 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() Posted: 27 September 2005 at 11:53am |
How do I pick up the action of the highlited row changing in a CXTPReportControl? Basically, the equivelant of OnSelChange() for a CListBox? Thanks, Brad |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Hi Brad,
There is an overridable method: virtual void CXTPReportControl::OnSelectionChanged() which sends XTP_NM_REPORT_SELCHANGED notify message to an owner. Also see XTPReportDefines.h for more report notifications. -- WBR, Serge |
|
![]() |
|
umcbrad ![]() Newbie ![]() Joined: 26 April 2005 Status: Offline Points: 10 |
![]() ![]() ![]() ![]() ![]() |
I've got the following code in my program. OnReportItemClick works fine, and the pRow member is always the row at the index of the row clicked, but in the other handler, the pRow member is always the row from index zero, and thus, GetIndex() returns zero, instead of the correct index. What am I doing wrong? ON_NOTIFY(NM_CLICK, IDC_RPT, OnReportItemClick) void CUnicorMedDlg::OnReportItemClick(NMHDR * pNotifyStruct, LRESULT * /*result*/) if (pItemNotify->pRow) void CUnicorMedDlg::OnSelectionChanged(NMHDR * pNotifyStruct, LRESULT * /*result*/) if (pItemNotify->pRow) Edited by umcbrad |
|
![]() |
|
sserge ![]() Moderator Group ![]() Joined: 01 December 2004 Status: Offline Points: 1297 |
![]() ![]() ![]() ![]() ![]() |
Yes, for the XTP_NM_REPORT_SELCHANGED message pNotifyStruct is NMHDR only.
You shouldn't convert it to XTP_NM_REPORTRECORDITEM. Unfortunately, there is a mistake in documentation. Multiple rows can be selected/unselected at one time and the message with a single row index will not be sent. You have to use CXTPReportControl::GetSelectedRows() method to retrieve a new selected rows collection. -- WBR, Serge |
|
![]() |
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 |