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!

DataGridTextBoxColumn.EndEdit

Ends an edit operation on the DataGridColumn.

[Visual Basic]
Protected Sub EndEdit()
[C#]
protected void EndEdit();
[C++]
protected: void EndEdit();
[JScript]
protected function EndEdit();

Remarks

To edit the value of a cell, call the DataRow object's BeginEdit before changing the value. You must invoke the AcceptChanges method on both the TBD and DataTable objects before the change is committed.

Example [Visual Basic]

The following example invokes the EndEdit method before editing a column's value.

[Visual Basic]

Private Sub EditGrid()
   ' Get the current DataGridColumn through the CurrentCell
   Dim dgCol As DataGridColumn
   Dim colNum As Long
   Dim rowNum As Long
   With DataGrid1.CurrentCell
      colNum = .ColumnNumber
      rowNum = .RowNumber    
   End With
   Set dgCol = DataGrid1.GridColumns(ColNum)
   ' Invoke the BeginEdit method.
    
   If DataGrid1.BeginEdit(dgCol, rowNum) Then
       ' Edit row value
      Dim myRow As DataRow
      Set myRow = dgCol.DataGridTable.DataTable.Rows(rowNum)
      myrow.BeginEdit
      myRow(colNum) = edit1.Text
      myRow.AcceptChanges
      datagrid1.datagridtable.DataTable.AcceptChanges
      Debug.Print "Edited?"
      datagrid1.EndEdit dgcol, rowNum, False
   Else
      Debug.Print "BeginEdit failed."
   End If
End Sub

See Also

DataGridTextBoxColumn Class | DataGridTextBoxColumn Members | System.WinForms Namespace