This documentation is archived and is not being maintained.

DataGridCell Constructor

Initializes a new instance of the DataGridCell class.

[Visual Basic]
Public Sub New( _
   ByVal r As Integer, _
   ByVal c As Integer _
)
[C#]
public DataGridCell(
   int r,
 int c
);
[C++]
public: DataGridCell(
   int r,
 int c
);
[JScript]
public function DataGridCell(
   r : int,
 c : int
);

Parameters

r
The number of a row in the System.Windows.Forms.DataGrid.
c
The number of a column in the System.Windows.Forms.DataGrid.

Example

[Visual Basic, C#, C++] The following example creates a DataGridCell and sets the new instance to the CurrentCell of a System.Windows.Forms.DataGrid control.

[Visual Basic] 
Private Sub SetCell()
   ' Set the focus to the cell specified by the DataGridCell.
   Dim dc As DataGridCell
   dc.RowNumber = 1
   dc.ColumnNumber = 1
   DataGrid1.CurrentCell = dc
End Sub


[C#] 
private void SetCell()
{
   // Set the focus to the cell specified by the DataGridCell.
   DataGridCell dc = new DataGridCell();
   dc.RowNumber = 1;
   dc.ColumnNumber = 1;
   dataGrid1.CurrentCell = dc;
}


[C++] 
private:
void SetCell()
{
   // Set the focus to the cell specified by the DataGridCell.
   DataGridCell dc;
   dc.RowNumber = 1;
   dc.ColumnNumber = 1;
   dataGrid1->CurrentCell = dc;
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataGridCell Structure | DataGridCell Members | System.Windows.Forms Namespace | CurrentCell | DataColumn | DataGrid | DataRow | ColumnNumber | RowNumber

Show: