Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Report control current cell?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Report control current cell?

 Post Reply Post Reply
Author
Message
brianh View Drop Down
Groupie
Groupie


Joined: 30 April 2004
Location: United Kingdom
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote brianh Quote  Post ReplyReply Direct Link To This Post Topic: Report control current cell?
    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.

Back to Top
Boyd View Drop Down
Senior Member
Senior Member


Joined: 08 December 2003
Location: United States
Status: Offline
Points: 285
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boyd Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
brianh View Drop Down
Groupie
Groupie


Joined: 30 April 2004
Location: United Kingdom
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote brianh Quote  Post ReplyReply Direct Link To This Post 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.



Edited by brianh
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.063 seconds.