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 » CExtPropertyGrid question Collapse All
Subject Author Date
Ulrich Heinicke May 27, 2008 - 2:38 AM

Hi,

my question is how i can receive the modified values from a CExtPropertyGrid, when the user press the apply button ?



thanks

Ulrich

Technical Support May 28, 2008 - 4:46 AM

The property grid control displays a tree like data structure called "property store". The property store is based on the CExtPropertyItem classes and derived from it. The root node is CExtPropertyStore. The other nodes are CExtPropertyCategory and CExtPropertyValue objects. Each property value contains two grid cells representing the active and default values. The property grid control displays active values. The default values allow you to reset the values (available from the context menu displayed over property value rows). If some property value has unequal active and default grid cells, this property value assumed as modified and displayed as bold row. You can invoke ValueActiveGet() and ValueDefaultGet() methods of the CExtPropertyValue object to get active and default grid cells.

Some more detailed information about property grid control. It’s designed as container for one or more tree grid windows displaying property store content and other windows called bars (toolbar, combo box bar, help tip bar). The CExtPropertyGridCtrl property grid control needs at least one tree grid window based on the CExtPropertyGridWnd class to be created inside it (by default two grids are created: CExtPropertyGridWndCategorized and CExtPropertyGridWndSorted). The bar windows can be not created at all. Each tree grid window contains cloned copies of the active grid cells stored in property values inside property store. When user completes editing of some grid cell describing active value of some property value, then the corresponding grid cells in other tree grid and active grid cell of property value inside property store becomes automatically synchronized with just edited grid cell. The CExtPropertyGridCtrl::OnPgcInputComplete() virtual notifies about end-of-editing event. The similar synchronization is performed when user reset’s some property value and CExtPropertyGridCtrl::OnPgcResetValue() notifies about reset event. You need to implement both virtual methods for complete tracking of value changing events.

The described above information allows you to get 100% controlled property grid control and apply any editing changes on-the-fly even without any Apply button outside the property grid control. If you need Apply button based approach, then you simply should walk through all the property items in the property store and detect modified property values using CExtPropertyItem::IsModified() method.