Print Page | Close Window

Report Control: Context Menu

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3485
Printed Date: 09 November 2025 at 7:15pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report Control: Context Menu
Posted By: leo_12
Subject: Report Control: Context Menu
Date Posted: 09 January 2006 at 3:58am

When right-clicking on a row in a ReportControl I expected the selection would be changed to the row where I clicked and the context menu is shown for that row.

In release 9.81 the focus is changed but not the selection. Therefore it is unclear whether the context menu is valid for the focused or for the selected row.

Why is the selection ignored if the focused row is not a GroupRow?

void CXTPReportControl::OnContextMenu(CWnd* /*pWnd*/, CPoint pos)
{

...  

if (pRow)
  {
   SetFocusedRow(pRow, !pRow->IsGroupRow() || pRow->IsSelected());
   pRow->OnContextMenu(ptClient);
  }

...
}

 

Any comments on that?




Replies:
Posted By: sserge
Date Posted: 09 January 2006 at 7:18am

Hi leo,

Actually there is a bug here. Just change condition a little and rebuild the Toolkit:

from:

   SetFocusedRow(pRow, !pRow->IsGroupRow() || pRow->IsSelected());
to:
   SetFocusedRow(pRow, !pRow->IsGroupRow() && pRow->IsSelected());

The idea is: do not reset multiple selection when you click at one of selected items, and reset (change) selection when click at not selected row or at the group row.

--
WBR,
Serge



Posted By: leo_12
Date Posted: 09 January 2006 at 8:07am
Thanks for your help!



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