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!

DataGridCell.ColumnNumber

Gets or sets the number of a column in the DataGrid control.

[Visual Basic]
Public Property ColumnNumber As Integer
[C#]
public int ColumnNumber {get; set;}
[C++]
public: __property int get_ColumnNumber();
public: __property void set_ColumnNumber(int);
[JScript]
public function get ColumnNumber() : int;
public function set ColumnNumber(int);

Property Value

The number of the column.

Remarks

The ColumnNumber value can be used to specify a DataColumn object in the DataTable associated with the DataGrid control.

Example [Visual Basic]

The following example assigns the CurrentCell property of a DataGrid to a DataGridCell. The value stored in the DataTable is returned by specifying DataRow and DataColumn objects through the RowNumber and ColumnNumber properties.

[Visual Basic]

Private Sub PrintCell()
   Dim myCell As DataGridCell
   ' Set the variable to the selected cell.
   myCell = DataGrid1.CurrentCell
   ' Get the value of the selected cell through the DataTable.
   Dim t As DataTable
   t = DataGrid1.CurrentGridTable.DataTable
   Console.WriteLine(t.Rows(myCell.RowNumber)(myCell.ColumnNumber))
End Sub

See Also

DataGridCell Structure | DataGridCell Members | System.WinForms Namespace | CurrentCell | DataColumn | DataRow | RowNumber