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.
Subject |
Author |
Date |
|
a a
|
Feb 9, 2006 - 6:29 PM
|
Is it possible to set a minimum and maximum value to cells with numeric content? (Just like the color cells does for limiting values in [0,255].) If not, I would implement it by deriving cell classes, but the only annoying point is that I have to check the actual data type (I’m using a ’value’ class for data abstraction, and the internal code might know the type without having to check). Thanks.
|
|
Technical Support
|
Feb 10, 2006 - 9:17 AM
|
Just override the OnQueryEnabledIncrement() and OnQueryEnabledDecrement() virtual methods. Here is the code from the CExtGridCellUpDownColorPart cell class in which the value can only be in the range of 0 to 255: bool CExtGridCellUpDownColorPart::OnQueryEnabledIncrement() const
{
ASSERT_VALID( this );
if( intVal >= 255 )
return false;
return true;
}
bool CExtGridCellUpDownColorPart::OnQueryEnabledDecrement() const
{
ASSERT_VALID( this );
if( intVal <= 0 )
return false;
return true;
}
|
|
a a
|
Feb 13, 2006 - 3:28 AM
|
|
|