1) There are several virtual methods which allow you to entirely control the inplace edit.
- CExtGridCell::OnInplaceControlTextInputVerify()
and CExtGridWnd::OnGridCellInplaceControlTextInputVerify()
are called when the user is typing text in the in-place editor. The methods return true
if the text data has a valid format; false
otherwise.
- CExtGridCell::OnParseText()
is called for parsing the text specified by the sText
parameter.
- CExtGridCell::OnInplaceControlPreTranslateMessage()
performs the message pre-translation for the in-place active editor and returns true
if the message has successfully been filtered by the cell object.
Please take a look at these methods in the documentation. You can use them to implement custom parsing and filtering for the inplace editor.
virtual bool OnGridCellInplaceControlTextInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
__EXT_MFC_SAFE_LPCTSTR sTextInitial,
__EXT_MFC_SAFE_LPCTSTR sTextPrevious,
CExtSafeString & sTextNew,
bool bEndEdit
);
If the
bEndEdit
parameter is
false
, the method is invoked each time when the user changes text in the editor. If the
bEndEdit
parameter is
true,
the editing is complete and you can return
true
or
false
depending on whether you want to apply or cancel the results of editing. Of course, you can use this method when the editing is complete. There are also several type-specific methods of this kind:
virtual bool OnGridCellInplaceControlDateTimeInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
COleDateTime dtInitial,
COleDateTime dtPrevious,
COleDateTime & dtNew,
bool bEndEdit
);
virtual bool OnGridCellInplaceControlDurationInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
COleDateTimeSpan dtSpanInitial,
COleDateTimeSpan dtSpanPrevious,
COleDateTimeSpan & dtSpanNew,
bool bEndEdit
);
virtual bool OnGridCellInplaceControlHotKeyInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
DWORD dwHotKeyInitial,
DWORD dwHotKeyPrevious,
DWORD & dwHotKeyNew,
bool bEndEdit
);
virtual bool OnGridCellInplaceControlSliderInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
INT nPosInitial,
INT nPosPrevious,
INT & nPosNew,
bool bEndEdit
);
virtual bool OnGridCellInplaceControlIPAddressInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
DWORD dwIPAddressInitial,
DWORD dwIPAddressPrevious,
DWORD & dwIPAddressNew,
bool bEndEdit
);
2) Auto completion combo box cells are not supported at the moment.
3) When you insert a new row, you should manually instantiate cells in columns. Typically grid cells are instantiated inside the grid window automatically when you invoke
CExtGridWnd::GridCellGet()
(you specify the desired run-time class information when calling it). This method allows you to instantiate grid cells in any area of the grid window having the coordinates specified by
nColNo
and
nRowNo
.