0

我想在 Windows Mobile 应用程序开发中获取 DataGrid 的行索引。没有像 Rowindex 这样的属性。那我们怎样才能得到rowindex。

有人知道吗?请分享

4

1 回答 1

0

尝试这样的事情:

void test() {
  int rowIndex = dataGrid1.CurrentRowIndex;
  DataGridCell cell = dataGrid1.CurrentCell;
  Console.WriteLine("Current Row Number: {0}, Column Number: {1}", cell.RowNumber, cell.ColumnNumber);
  Console.WriteLine("Row {0}, Column 0 data: {1}", rowIndex, dataGrid1[rowIndex, 0]);
}
于 2011-12-27T16:31:06.263 回答