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 » CExtGridCellCheckBox & __EGCS_READ_ONLY Collapse All
Subject Author Date
Eric Houvenaghel Aug 25, 2006 - 11:28 AM

When using CExtGridCellCheckBox with the __EGCS_READ_ONLY style, the cells checkbox is greyed out.
Basically, is it posible to have a read only cell checkbox without them being greyed out?
The only way I can think of is to block the click events on a non read only cell checkbox.
I’m hoping for an easier way.
If there is not can you point me in the right direction.

Thank you.

Technical Support Aug 26, 2006 - 6:51 AM

You should create and use a CExtGridCellCheckBox-derived class and implement the CExtGridCell::OnPaintCheck() virtual method in it. Copy and paste the body of the original method except for the following lines at the beginning:

    bool bReadOnly = 
        ( (dwCellStyle&__EGCS_READ_ONLY) != 0 )
            ? true : false;
Replace these lines with:
bool bReadOnly = false

Eric Houvenaghel Aug 28, 2006 - 1:15 PM

Thanks, that works great!
I’m guessing that most "specialized" functionalities should be solved in this manner?
i.e. Via overriding virtual functions?
I actually have several others functionalities to implement.
I’ll let you know if I get stuck.

Thanks again.

Technical Support Aug 29, 2006 - 10:12 AM

Yes, you are right. There are many virtual methods in the CExtGridCell cell class which you can override to achieve any custom behavior. These methods are marked as Overridables in the documentation.