Professional UI Solutions
Site Map   /  Register


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 » Apply method to erase the whole grid? Collapse All
Subject Author Date
Takis Takoglou Apr 8, 2009 - 5:20 AM

Good Day,

while using your property grid :

1)I create a property grid

2)I add several properties in it

3)In the apply method of a cell I want to perform the following: To empty the property grid completely,as if it were a new one, so that it can be used later for new properties/values. I would also like to delete permanently all the items from it if possible.


Thanx in advance



Technical Support Apr 14, 2009 - 11:39 AM

You can handle modification of any property value in your CExtPropertyGridCtrl-derived class which implements two virtual methods: CExtPropertyGridCtrl::OnPgcInputComplete() and CExtPropertyGridCtrl::OnPgcResetValue(). These two virtual methods represent two possible ways of changing any property value: editing a grid cell and invoking the Reset command from the context menu displayed over the property value.

Technical Support Apr 8, 2009 - 6:50 AM

The CExtPropertyItem::Apply() virtual method is not a good place for changing the selected property store in the property grid control. There are two virtual methods in the CExtPropertyGridCtrl class which allow you to handle all the possible changing events of any property values: CExtPropertyGridCtrl::OnPgcInputComplete() and CExtPropertyGridCtrl::OnPgcResetValue(). You should implement these virtual methods. Your methods should invoke the parent class methods first and then analyze the changed grid cell value of the property value object and perform property store assignment. You can either assign the new property store with the CExtPropertyGridCtrl::PropertyStoreSet() method or change the structure of the currently selected property store and then invoke the CExtPropertyGridCtrl::PropertyStoreSynchronize() method. Please note, any CExtPropertyItem can be hidden in the property grid control if its CExtPropertyItem::CanBeInsertedIntoPropertyGrid() virtual method returns false.

Takis Takoglou Apr 10, 2009 - 8:10 AM

Thank you very much!

Another minor problem has arised:

Icannot change the text color of my PropertyGrid Cell which contains the Property Category i.e. the first column cell

I tried to do the following:

            CExtGridCell * pCellValue = GridControl.GetActiveGrid()->GridCellGet(i,j,0,0);

            pCellValue->TextColorSet (CExtGridCell::__ECS_NORMAL,RGB(255,0,0));


but nothing happened... anty ideas?

Thanx in advance,


Technical Support Apr 13, 2009 - 1:23 PM

Each CExtPropertyValue object contains two CExtGridCell objects representing the active and default values. The CExtPropertyGridCtrl control contains two tree grids (sorted and categorized) displaying property values and the grid cells each of these tree grids are the cloned copies of the active grid cell inside the CExtPropertyValue object. When the user finishes editing some grid cell in the active tree grid window, then the property grid control automatically synchronizes grid cell of the same property value in the inactive tree grid windows and inside the CExtPropertyValue object.

We recommend you to change the active grid cell of the CExtPropertyValue property value and then invoke the CExtPropertyGridCtrl::PropertyStoreSynchronize() method or the CExtPropertyGridCtrl::PropertyValueSynchronizeSimple() method the true flag in the bUpdateActiveTreeGridWindow parameter.

Takis Takoglou Apr 14, 2009 - 2:03 AM

Unfortunately you didn’t understand my question, (or didn’t i understand the answer?:s )

Anyway to make things clearer, I have a Property Value represented in 2 Cells.

The first cell is that which holds my Property Value name e.g. "Color"

The second cell is of CExtGridCellComboBox Type and contains several values,

What i want to change is the color,font,weight etc of the first cell.

For example when someone makes a change in the value, i want the "Color" caption to become red or something.

Thanx in advance,