[C#]
private void SetCellValue(DataGrid myGrid){
DataGridCell myCell = new DataGridCell();
// Use an arbitrary cell.
myCell.RowNumber = 1;
myCell.ColumnNumber = 1;
// Change the cell's value using the CurrentCell.
myGrid[myCell]="New Value";
}
private void GetCellValue(DataGrid myGrid){
DataGridCell myCell = new DataGridCell();
// Use and arbitrary cell.
myCell.RowNumber = 1;
myCell.ColumnNumber = 1;
Console.WriteLine(myGrid[myCell]);
}
private void SetCellValue(DataGrid myGrid){
DataGridCell myCell = new DataGridCell();
// Use an arbitrary cell.
myCell.RowNumber = 1;
myCell.ColumnNumber = 1;
// Change the cell's value using the CurrentCell.
myGrid[myCell]="New Value";
}
private void GetCellValue(DataGrid myGrid){
DataGridCell myCell = new DataGridCell();
// Use and arbitrary cell.
myCell.RowNumber = 1;
myCell.ColumnNumber = 1;
Console.WriteLine(myGrid[myCell]);
}
第二个回答才是winform的
最简单还是dataGrid[5,4].ToString()
should be
dataGrid[4,3].ToString()