Browse by category:
|| | ||
Is there an ability to prevent a record from being written to the database whenever a row is updated or inserted in the database?
You should override OnFlushRecord(). OnFlushRecord() is called whenever a record should be updated or added to the recordset.
By overriding OnFlushRecord(), you can validate all records contents at record level. Objective Grid will always call OnFlushRecord() before it tries to position the current cell to a new row.
If the data in the current record are invalid, you should return FALSE. Objective Grid will then abort its current operation and not try to move the record pointer to a new row any more.
|BOOL CMyRecordGrid::OnFlushRecord(ROWCOL nRow, CString* ps)
|// check if current record is valid
return CGXODBCGrid::OnFlushRecord(nRow, ps);
|Objective Grid: Changing the calendar months and days to a...||Objective Grid: Determining the columns and rows of a selection|