i have used UG a long time ago
here is a untested sample to get you started with cell editing
int MyCug::OnEditFinish(int col, long row,CWnd *edit,LPCTSTR string,BOOL cancelFlag)
{
UNREFERENCED_PARAMETER(*edit);
CString strOldText = QuickGetText(col, row);
CString strNewText = string;
if(strNewText.GetLength() < 10)
{
AfxMessageBox(_T("The text must be minimum 10 characters"));
QuickSetText(col,row,strOldText);
return FALSE;
}
QuickSetText(col,row,strNewText);
return TRUE;
}
Note: This code has not been tested ,written for only to explain logic