Print Page | Close Window

Report control current cell?

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=1623
Printed Date: 17 July 2025 at 9:00pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Report control current cell?
Posted By: brianh
Subject: Report control current cell?
Date Posted: 05 January 2005 at 11:31am

Hi, in my application the user can dynamically add columns to the report control and I want to allow them to remove columns too, but there doesn't appear to be any concept of a current cell in the report control so there is no intuitive way to select a column for deletion.  I can find the focused row but there is no equivalent focused column.   Am I missing something? Thanks.




Replies:
Posted By: Boyd
Date Posted: 05 January 2005 at 12:43pm

I'm not certain if there is a way to determine the focused column, but you do have one alternative.

I always use the right-click menu on the column header for actions such as this, and it is possible to determine which column the user right-clicked on.  I don't use the MFC version, but the ActiveX version has a ColumnClick event as well as a HitTest method (both of which can be used to provide right-click menus for a column).  The MFC version must surely have an equivalent approach.  Since you know which column triggered the right-click menu, you'll know which column to remove if the user chooses that action.



Posted By: brianh
Date Posted: 06 January 2005 at 3:43am

Thanks Boyd, I never thought about the headers, I should be able to handle the normal MFC message for the context menu and by using the HitTest() method of the column header I could then find the associated column and add/enable the "delete" item in the context menu.

I like to use a context menu for this kind of thing too, but I usually have a main menu item and toolbar button for the same purpose, so it would be nice if the grid maintained a "current column" to allow this, but until then the context menu will have to do.

Thanks again.




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