ComponentOne True DataControl 8.0
UserWriteData Event

 

UserWriteData Event

Occurs when a row needs to be modified in DataMode = 2 - UserEvents.

Syntax

TData_WriteData (ByVal RowBuf As TrueData60Ctl.RowBuffer, WriteLocation As Variant)

Remarks

Arguments: RowBuf is a RowBuffer object used to transfer modified row data from the TData control to your custom data source.

WriteLocation is a variant bookmark that uniquely identifies the row to be updated.

In user events mode (DataMode set to 2 - User Events), the UserWriteData event is fired whenever a row of data has been modified and the user commits the changes by leaving the modified row or calling Recordset.Update. You do not need to write a handler for this event unless you want to create your own data source. See User Events Mode for details.

The RowBuf argument contains a single row of data to be written (updated) to your custom data source. Since only one row of data can be updated at a time, the value of its RowCount property will always be 1. The number of columns in a RowBuffer is given by its ColumnCount property.

The WriteLocation argument contains a bookmark supplied by your application in either the UserReadData or UserAddData event.

The Value property of the RowBuf argument contains the field data modified by the user. If the user did not modify a particular field, then the corresponding entry in the Value property will contain an Empty variant. In Visual Basic, the IsEmpty function can be used to test for this condition.

If your event handler is unable to modify the specified row, you should notify the TData control by setting the WriteLocation argument to Null. The TData control will interpret this as a signal that the row has not been updated due to an error condition. If you can qualify the error condition, use the RaiseError method to describe the error. Then the TData control's clients, the bound controls, will receive the appropriate error information.

See Also

TData Control

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback