J. Doe Asked:2020-01-06 19:55:34 +0000 UTC2020-01-06 19:55:34 +0000 UTC 2020-01-06 19:55:34 +0000 UTC 如何从 WPF 中的 DataGridRow 获取单元格? 772 有必要从 DataGrid'a 行的第一个单元格接收值。 怎么做? c# 1 个回答 Voted Best Answer J. Doe 2020-01-07T17:15:24Z2020-01-07T17:15:24Z 找到了答案。一切都变得非常简单。 private void DataGridRow_MouseDoubleClick(object sender, MouseButtonEventArgs e) { DataGridRow row = sender as DataGridRow; if (row != null) { // dg - мой DataGrid TextBlock tbl = dg.Columns[0].GetCellContent(row) as TextBlock; Data = tbl.Text; } }
找到了答案。一切都变得非常简单。