Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

You can set a range for a cell of the CExtGridCellUpDown type by overriding the OnQueryEnabledIncrement() and OnQueryEnabledDecrement() virtual methods of this class. Here is a sample code that sets 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;
}