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 » CExtPropertyCategory sort Collapse All
Subject Author Date
Andrew Cochran Jul 13, 2006 - 8:55 AM

I need a specific sorting in a property category of a CExtPropertyGridCtrl. Now cells and subcategories are sorted in alphabetical order. I want subcategories to be sorted first and placed at the begining, and then all other cells the same. For example:

I have:

Category1
Category 2
Property1
SubCategory 1
subProperty1
subproperty2
.......
Property2
SubCategory 2
subProperty1
subProperrty2
..........
...........

I need:

Category1
Category 2
SubCategory 1
subProperty1
subproperty2
.......
SubCategory 2
subProperty1
subProperrty2
..........
Property1
Property2
...........

Please, can you explain me how to do that?

Technical Support Jul 13, 2006 - 12:43 PM

The property item order like you need can be organized using the following two conditions:

1) You should invoke the following code before assigning the property store to the property grid control:

CExtPropertyGridCtrl * pPGC = . . .
CExtPropertyGridWnd * pPGW =
    STATIC_DOWNCAST( CExtPropertyGridWnd,
        pPGC->GetChildByRTC( RUNTIME_CLASS( CExtPropertyGridWndCategorized ) ) );
    pPGW->m_bSortedCategories = false;


2) You should insert your property values and property categories into each sublevel of the property tree using the same order which you want to see on the screen. The previous step turnes off any sorting in the property grid.

Andrew Cochran Jul 19, 2006 - 2:45 AM

Thank you, very much.

It was helpfull!

Best regards!