The following virtual method is invoked for all the grid cells when editing is complete and cell value is changed:
virtual void OnGridCellInputComplete(
CExtGridCell & _cell,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
HWND hWndInputControl = NULL
);
The following virtual method is invoked during text typing (
bEndEdit==false
) and finally before editor window closing (
bEndEdit==true
) and allows you to verify edited text:
virtual bool OnInplaceControlTextInputVerify(
HWND hWndInplaceControl,
CExtGridWnd & wndGrid,
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
) const;
If the edited text is not valid, then you can simply return
false
to roll back the last text changing. You can also modify the
sTextNew
text.