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 General Discussion » Property grid: property selection Collapse All
Subject Author Date
a a May 25, 2006 - 3:07 AM

Hi.

I would like to be notified when the user selects a property (either by clicking, or with arrow keys) in the property grid.
How do you do that?

Thanks.

Technical Support May 25, 2006 - 9:17 AM

The CExtPropertyGridCtrl control works like a container for all its child windows. When the selection changes in the active tree grid window, the property grid control performs selection synchronization in all the inactive tree grid windows and finally invokes the CExtPropertyGridCtrl::RedrawFocusDependentChildren() virtual method which you can override in your CExtPropertyGridCtrl-derived class. Your method should invoke the parent class method and analyze the focused property item in the active tree grid window using the following code:

CExtPropertyGridCtrl * pPGC = . . .
CExtPropertyGridWnd * pActiveTreeGrid = pPGC->GetActiveGrid();
       if( pActiveTreeGrid == NULL )
              return . . .
HTREEITEM hTreeItem = pActiveTreeGrid->ItemFocusGet();
       if( hTreeItem == NULL )
              return . . .
CExtPropertyItem * pPropertyItem =
              pActiveTreeGrid->PropertyItemFromTreeItem( hTreeItem );
       ASSERT_VALID( pPropertyItem );
Please note the pPropertyItem pointer variable can be either CExtPropertyValue or CExtPropertyCategory.

a a May 25, 2006 - 8:40 PM

Thanks.