Here are the answers to your questions:
1. To hide the property grid’s combo box, use the following code:
CExtPropertyGridComboBoxBar * pWnd =
STATIC_DOWNCAST(
CExtPropertyGridComboBoxBar,
m_PGC.GetChildByRTC(
RUNTIME_CLASS(CExtPropertyGridComboBoxBar)
)
);
if( pWnd != NULL )
{
pWnd->ShowWindow( SW_HIDE );
m_PGC.RecalcLayout();
}
2. To change the colors of the read-only edit, create a cell class and override its
OnInplaceControlCreate
virtual method. Here the code which sets the text color to red and the background color to green
HWND CMyGridCellString::OnInplaceControlCreate(
CExtGridWnd & wndGrid,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcInplaceControl,
LONG nLastEditedColNo,
LONG nLastEditedRowNo
)
{
ASSERT_VALID( this );
ASSERT_VALID( (&wndGrid) );
HWND hWndEdit =
CExtGridCell::OnInplaceControlCreate(
wndGrid,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl,
nLastEditedColNo,
nLastEditedRowNo
);
if( hWndEdit == NULL )
return NULL;
CExtGridInplaceEdit * pEdit =
static_cast < CExtGridInplaceEdit * > ( CWnd::FromHandle( hWndEdit ) );
ASSERT( pEdit != NULL );
ASSERT_VALID( pEdit );
pEdit->SetTextColor( RGB(255,0,0) );
pEdit->SetBkColor( RGB(0,255,0) );
return hWndEdit;
}