When overridden in a derived class, inititates a request to complete an editing procedure.
[Visual Basic] MustOverride Public Function Commit( _ ByVal dataSource As ListManager, _ ByVal rowNum As Integer _ ) As Boolean [C#] public abstract bool Commit( ListManager dataSource, int rowNum ); [C++] public: virtual bool Commit( ListManager* dataSource, int rowNum ) = 0; [JScript] public abstract function Commit( dataSource : ListManager, rowNum : int ) : Boolean;
true if the editing procedure committed successfully; otherwise, false.
Call the Commit method when the DataGridColumn receives a request to complete editing. If this is not possible without error, return false.
The Commit method is called by the DataGrid control's public method OnMouseDown. The method is also called by other private methods, for example, when the current row is changed.
The following example shows a possible override of the Commit method. The code invokes the SetColumnValueAtRow method, then sets a variable that allows other functions to determine whether the column is still in edit more. The code then calls the Invalidate method to redraw the control. Finally, a the function returns true to indicate the change has been committed.
[Visual Basic]
Overrides Function OnCommit(ByVal dataView As Data.System.Data.DataView, _ ByVal rowNum As Long) As Boolean SetColumnValueAtRow(dataView, rowNum, currentValue) isEditing = False Invalidate OnCommit = True End Function
DataGridColumn Class | DataGridColumn Members | System.WinForms Namespace | Edit | SetColumnValueAtRow