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 » About CExtPropertyCtrl Collapse All
Subject Author Date
tera t Mar 18, 2008 - 7:18 PM

Hello.

I acquire a cell in the property grid directly and operate it.
http://www.yukai.jp/~ifreeta/20080319/image10.jpg

CExtGridCell * CMuPropertyGridCtrl::SelectGridCell( CString csFind )
{
int iRow;

    CTypedPtrArray < CPtrArray, CExtPropertyGridWnd * > arrGrids;
    OnPgcQueryGrids( arrGrids );
    if ( arrGrids.GetSize() <= 0 ){
        ASSERT(0);
        return NULL;
    }
    CExtPropertyGridWnd * pGrid = arrGrids[ 0 ];
    CString csDst;

    for ( iRow = 0 ; iRow < pGrid->RowCountGet() ; iRow++){
        CExtPropertyGridCellArea * pCell =
            (CExtPropertyGridCellArea *)pGrid->GridCellGet( 0 , iRow , 0 , 0 );
        pCell->TextGet(csDst);
        if ( csFind == csDst){
            return pGrid->GridCellGet( 1 , iRow , 0 , 0 );
        }
    }
}


However, I cannot acquire a cell when a property grid was closed.
http://www.yukai.jp/~ifreeta/20080319/image11.jpg

I want to acquire a cell then.
Thanks,

Technical Support Mar 19, 2008 - 6:50 AM

You should use the active and/or default grid cells stored in the CExtPropertyValue object. The tree grid windows inside the property grid control contain cloned copies of the active grid cells from the CExtPropertyValue objects. When some grid cell inside active tree grid is edited by the user, then it’s value becomes finally assigned to the grid cell in the inactive tree grid and to the active grid cell stored inside the corresponding CExtPropertyValue object. So, you should access the active grid cell in the property value first:

CExtPropertyValue * pPV = . . .
CExtGridCell * pCellSrc = pPV->ValueActiveGet();
     ASSERT_VALID( pCellSrc );
Then you should modify a value of the pCellSrc grid cell and synchronize corresponding cells in the tree grid windows inside the property grid control as we described in the previous answer.