Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » How to detect a click on a CExtPropertyGridCtrl property Collapse All
Subject Author Date
Eric Feb 4, 2011 - 12:07 PM

Hello,


I have a CExtPropertyGridCtrl filled with many categories and properties. I would like to detect a click on a property’s name(left column), and get access to this property’s name.


I noticed that when a click on a property occurs, the description change accordingly to the property’s description. I need to get access to the property’s name at that moment.


How do I do that from a derived class of CExtPropertyGridCtrl?


Thanks!

Eric Feb 15, 2011 - 8:08 AM

Thanks for your help!

Technical Support Feb 9, 2011 - 11:52 AM

You can override the CExtGridWnd::OnGridCellQueryBackColor() virtual method and provide any grid cell with a custom color. In the case of a report grid control, the outer header cells in the top header row are CExtReportGridColumn column objects and CExtReportGridItem pointers can be used as HTREEITEM tree row handles when invoking APIs of the CExtTreeGridWnd class. So, you can use the CExtTreeGridWnd::ItemGetByVisibleRowIndex() and CExtTreeGridWnd::ItemGetVisibleIndexOf() methods for conversion between plain row indexes of CExtGridWnd class API and CExtReportGridItem pointers / HTREEITEM tree row handles.

Eric Feb 7, 2011 - 12:44 PM

Thanks a lot, it works well now!


I have another question. I’m using a CExtReportGridWnd. The grid is like the last one of the FilteredGrids-m.exe in the samples(Filtered Report Grid).


I need to focus or highlight a particular column without losing the current rows selection.


So I have the column’s name, the only thing I need to do is to focus or highlight this particular column(or all of it’s visible cells).

There are many columns, so if the one that needs to be focused on is not currently visible, it needs to scroll to that

column. I can access to the grid only from the outside.


How can I do that?

Technical Support Feb 5, 2011 - 11:07 AM

The CExtPropertyGridCtrl is designed as a container for one or more tree grid controls displaying properties. By default two tree grids are created: CExtPropertyGridWndCategorized and CExtPropertyGridWndSorted. These tree grids are instantiated in the CExtPropertyGridCtrl::OnPgcCreateGrids() virtual method. You should override it and create your instances of tree grid classes. Your tree grids should implement the CExtGridBaseWnd::OnGbwAnalyzeCellMouseClickEvent() virtual method for handling grid mouse clicks. There are two colums: column 0 contains name cells and 1 contains value cells. The CExtTreeGridWnd::ItemGetByVisibleRowIndex() method allows you to convert plain row indexes into HTREEITEM tree grid row handles. The CExtPropertyGridWnd::PropertyItemFromTreeItem() method allows you to convert HTREEITEM tree grid row handles into CExtPropertyItem * property value pointers.