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 » How to prevent CExtPropertyGridCtrl height change Collapse All
Subject Author Date
Offer Har Jan 21, 2007 - 8:52 AM

Dear Support,

I need to prevent the user from changing the height of CExtPropertyGridCtrl rows.

Thanks,
Ron.

Technical Support Jan 22, 2007 - 11:29 AM

The property grid control contains two tree grid windows initialized by default: categorized property tree and sorted property tree. Both cannot be resized by default. We can guess you have custom trees in the property grid. If it is the case, could we take a look at the code that initializes these tree grids?

Offer Har Jan 23, 2007 - 9:30 PM

My mistake - I meant width.

Technical Support Jan 24, 2007 - 12:04 PM

The CExtPropertyGridCtrl control is a container for one or more tree grid windows. By default, there are two tree grids in it: CExtPropertyGridWndCategorized and CExtPropertyGridWndSorted. So you should get pointers to these grids and change their settings:

void EnablePropertyGridColumnResizing( CExtProperyGridCtrl * pPGC, bool bEnable = true )
{
CTypedPtrArray < CPtrArray, CExtPropertyGridWnd * > arrGrids;
    pPGC->OnPgcQueryGrids( arrGrids );
DWORD dwStylesAdd = bEnable ? (__EGBS_RESIZING_CELLS_INNER_H|__EGBS_DYNAMIC_RESIZING_H) : 0;
DWORD dwStylesRemove = bEnable ? 0 : (__EGBS_RESIZING_CELLS_INNER_H|__EGBS_DYNAMIC_RESIZING_H);
INT nGridIdx = 0, nGridCount = arrGrids.GetSize();
    for( ; nGridIdx < nGridCount; nGridIdx ++ )
    {
        CExtPropertyGridWnd * pGrid = arrGrids[ nGridIdx ];
        ASSERT_VALID( pGrid );
        pGrid->SiwModifyStyle(
            dwStylesAdd,
            dwStylesRemove
            );
    }
}