It is not completely clear what you mean by "double-s" and "int-s". If you need a CExtGridCellUpDown
which uses double values instead of integers, it is easy to do.
Actually CExtGridCellUpDown
extends CExtGridCellNumber
. The latter is based on VARIANT
and allows you to use the following VARIANT types to store a numeric value:
- VT_I1
- VT_I2
- VT_UI1
- VT_UI2
- VT_I4
- VT_UI4
- VT_I8
- VT_UI8
- VT_R4
- VT_R8
- VT_INT
- VT_UINT
- VT_BOOL
- VT_ERROR
- VT_DATE
- VT_CY
- VT_DECIMAL
As you can see, you can use any of these types including doubles (
VT_R8
).
Here is a code snippet which assigns a double value to a cell:
CExtGridCellUpDown * pCellUpDown =
STATIC_DOWNCAST(
CExtGridCellUpDown,
m_wndGrid.GridCellGet(
0,
1L,
0,
0,
RUNTIME_CLASS(CExtGridCellUpDown)
)
);
pCellUpDown ->_VariantAssign( DOUBLE(0.000000123456789) );
Note that, by default, increasing/decreasing operations change the cell value by 1 (one) and, if you need to change this behavior, you should override the following virtual methods:
CExtGridCellVariant::OnValueDecrement(
LPVARIANT pvarValue
)
CExtGridCellVariant::OnValueIncrement(
LPVARIANT pvarValue
)