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 » How to use Property Grid Collapse All
Subject Author Date
exp lnt Jul 2, 2008 - 2:50 AM

Hello,


I have a problem with Property Grid,


I used a Property Grid for storing a Text Property such as


Appearance


  Text


  Justification


Font


  Font color


  Bounds


     x position


     y Postion


     with


    height


.....


 Questions


 1. How to update value of the height immediately while editing the width ?


 2. How to expan only property at the once time ? For example : If the user click to Font,  it is expanded, the rest are collapsed.


Thank you !

exp lnt Jul 3, 2008 - 12:46 AM

 


Thanks for your help !


Explnt,

Technical Support Jul 2, 2008 - 11:21 AM

There are two ways to catch property value editing events:

1) Implement and use your CExtPropertyValue-derived classes. This is difficult way. It’s used in the PropertyGrid sample application.

2) The easy way. It’s used in the CompoundProperties sample application. Implement and use your CExtPropertyGridCtrl-derived classes which overrides the CExtPropertyGridCtrl::OnPgcInputComplete() and CExtPropertyGridCtrl::OnPgcResetValue() virtual methods. These methods are universally handling all the possible modifications of all the property values in the property grid control. The CExtPropertyGridCtrl::OnPgcInputComplete() virtual method is invoked when the value is changed by user. The CExtPropertyGridCtrl::OnPgcResetValue() virtual method is invoked when the Reset menu command is clicked in the context menu displayed over the property value.

You need to know additionally the following:

1) The property grid control is container for one or more tree grid windows.

2) Each tree grid window contains cloned copies of the active value grid cells from the CExtPropertyValue objects.

3) When editing or resetting of some grid cell in the active tree grid window is complete, then the CExtPropertyGridCtrl::OnPgcInputComplete() or CExtPropertyGridCtrl::OnPgcResetValue() virtual method is invoked. Default implementations of this method are performing synchronization of grid cells in background tree grid windows and active value cell in the CExtPropertyValue object from just edited grid cell. So, if you overriding these virtual methods, then you should invoke parent class methods first.

4) If you have changed the active grid cell stored inside the CExtPropertyValue object, then you should synchronize property grid control to make new cell value displayed in its tree grids. The CExtPropertyGridCtrl::PropertyStoreSynchronize() method reloads all the grid cells for all the property values in the property grid control. The CExtPropertyGridCtrl::PropertyValueSynchronizeSimple() method (new in Prof-UIS 2.83) reloads only one specified property value.

So, if you are handing the Widths changing, then you should find grid cell which represents active value in the CExtPropertyValue object that is Height property, modify grid cell and synchronize property grid control finally.

The automatic expanding of only one tree branch is not supported by tree grid windows used inside property grid control.