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 » Disable Grid Collapse All
Subject Author Date
Eddie Judson Jul 17, 2006 - 11:38 PM

Hi,
I have a grid in a dialog that I would like to disable and have it look grey lilke the rest of the disabled controls, is there an easy way of doing this?
Regards,
Eddie

Technical Support Jul 18, 2006 - 9:41 AM

Unfortunately at the moment the grid does not check if it is disabled and does not pant the background grayed. But there is a workaround. You can override the CExtGridWnd::OnSiwPaintBackground() method in this way:

void CDemoGrid::OnSiwPaintBackground(
 CDC & dc,
 bool bFocusedControl
 ) const
{
 ASSERT_VALID( this );
 CExtGridWnd::OnSiwPaintBackground( dc, bFocusedControl );
CRect rcGridInner = OnSwGetClientRect();
 if(  (! dc.RectVisible( &rcGridInner ))
  || IsWindowEnabled()
  )
  return;
COLORREF clrFill =
  OnSiwGetSysColor( COLOR_3DFACE );
 dc.FillSolidRect( &rcGridInner, clrFill );
 
}