private void PrintCellValues(DataGrid myGrid){
    int iRow;
    int iCol;
    DataTable myTable;
    // Assumes the DataGrid is bound to a DataTable.
    myTable = (DataTable) dataGrid1.DataSource;
    for(iRow = 0;iRow < myTable.Rows.Count ;iRow++) {
       for(iCol = 0;iCol < myTable.Columns.Count ;iCol++) {
          Console.WriteLine(myGrid[iRow, iCol]);
       }
    }
 }

解决方案 »

  1.   

    string str = this.dataGrid1[1,0].ToString();
      

  2.   

    private object GetData(int row,int column)
    {
        return this.dataGrid[row,column];
    }
      

  3.   

    使用:DataGridCell示例
    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;
    }