MS Flex Grid control is very difficult for complex CELL content. There is a program on www.vchelp.net, which is the CELL of a column as Checkbox. We can join the input of a column of GRID to enter a reference, that is, the content of this column can only come from the database, the method is as follows
Implement two news, shoot: DoubleClick and KeyDown,
When these events occur, a dialog box is popped, defining a Combox in the dialog, which is from the database.
void CPageComplete :: OnDblClickMsflexgridCorp () {// TODO: Add your control notification handler code here long nCurCol = m_CorpGrid.GetCol (); long nCurRow = m_CorpGrid.GetRow (); if (m_CorpGrid.GetCol () == 2) {CDlgSelCorpType DlgSelcorptype; if (DLGSelcorptype.domodal () == idok) {cstring str = DLGSELCORPTYPE.M_STRSELCORPTYPE; M_CORPGRID.SETTEXT (STR);}}
}
void CPageComplete :: OnKeyDownMsflexgridCorp (short FAR * KeyCode, short Shift) {// TODO: Add your control notification handler code here long nCurCol = m_CorpGrid.GetCol (); long nCurRow = m_CorpGrid.GetRow (); if (m_CorpGrid.GetCol ( ) == 2) {CDLGSELCORPTYPE DLGSELCORPTYPE; if (DLGSelcorPType.Domodal () == idok) {cstring str = DLGSELCORPTYPE.M_STRSELCORPTYPE; m_corpgrid.setText (STR);}}}
. . . . . . . to be continued. . . . . . . . . . . .