How can I programmatically edit a record in the data source?

The following sample code shows you how you can programmatically change a record to your data source.

Example:

   // Change the contents of nRow in the grid.
   if (CanUpdate())
   {
      // Enter edit-mode
      Edit(nRow);
      // Lock updating the grid
      BOOL bLock = LockUpdate(TRUE);
      SetValueRange(CGXRange(nRow, 1), "1");
      SetValueRange(CGXRange(nRow, 2), "2");
      // Unlock painting
      LockUpdate(bLock);
      // Flush pending changes, Update will also redraw
      // the row.
      Update();
   }

Please note that this code depends only on CGXBrowserGrid-functionality and thus makes appending rows independent from your specific data source.  You can use the same code for appending a row to a DAO recordset, ODBC recordset or any other external data source.