DataGridCell::ToString Method ()

 

Gets the row number and column number of the cell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
virtual String^ ToString() override

Return Value

Type: System::String^

A string containing the row number and column number.

The following example returns the row number of the System.Windows.Forms::DataGrid control's CurrentCell using the DataGridCell object's ToString method.

private:
   void Grid_MouseUp(
      Object^ sender, System::Windows::Forms::MouseEventArgs^ /*e*/ )
   {
      DataGrid^ dg = (DataGrid^)(sender);
      DataGridCell myCell = dg->CurrentCell;
      Console::WriteLine( myCell.ToString() );
   }

.NET Framework
Available since 1.1
Return to top
Show: