NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataGridColumn.Commit

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;

Parameters

dataSource
The TBD for the DataGridColumn.
rowNum
The number of the row being edited.

Return Value

true if the editing procedure committed successfully; otherwise, false.

Remarks

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.

Example [Visual Basic]

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

See Also

DataGridColumn Class | DataGridColumn Members | System.WinForms Namespace | Edit | SetColumnValueAtRow