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!

DataGridBoolColumn.Edit

Prepares the cell for editing a value.

[Visual Basic]
Overrides Public Sub Edit( _
   ByVal source As ListManager, _
   ByVal rowNum As Integer, _
   ByVal bounds As Rectangle, _
   ByVal readOnly As Boolean, _
   ByVal instantText As String, _
   ByVal cellIsVisible As Boolean _
)
[C#]
public override void Edit(
   ListManager source,
   int rowNum,
   Rectangle bounds,
   bool readOnly,
   string instantText,
   bool cellIsVisible
);
[C++]
public: override void Edit(
   ListManager* source,
   int rowNum,
   Rectangle bounds,
   bool readOnly,
   String* instantText,
   bool cellIsVisible
);
[JScript]
public override function Edit(
   source : ListManager,
   rowNum : int,
   bounds : Rectangle,
   readOnly : Boolean,
   instantText : String,
   cellIsVisible : Boolean
);

Parameters

source
The DataView of the edited column.
rowNum
The row number of the edited column.
bounds
The System.WinForms.DataGridBoolColumn.Rectangle in which the control is to be sited.
readOnly
A value indicating whther the control's value is read only. true if the value is read only; otherwise, false.
instantText
The text to display in the cell.
cellIsVisible
[To be supplied.]

Remarks

Unlike the typical implementation of this method (as described in the DataGridColumn class), the Edit method doesn't site a control for editing the column value. Instead a check box is drawn when the Paint method is called.

Example [Visual Basic]

The following example overrides the base class's Edit method. Two variables are checked to ensure that the column is in an editable state. Then a variable (IsEditing) is set to signal that an edit is occurring. The GetColumnValueAtRow method is called to set a variable to the current value. Finally, the base class's Invalidate method is called to repaint the column.

[Visual Basic]

Overloads Overrides Sub OnEdit( _
   ByVal view As Data.System.Data.DataView, _
   ByVal rowNum As Long, ByVal bounds As UI.System.Drawing.Rectangle, _
   ByVal readOnly As Boolean)

   isEditing = True
   editingRow = rowNum
   currentValue = GetColumnValueAtRow(view, rowNum)
   MyBase.Invalidate
End Function

See Also

DataGridBoolColumn Class | DataGridBoolColumn Members | System.WinForms Namespace