DataGridRow Cells属性

时间:2010-03-24 09:54:52

标签: visual-studio-2008 silverlight properties

我想获得DataGridRow Cells属性。它是当前DataGrid中的单元格表。但我不能直接从代码或反射访问:

var x = dataGridRow.GetType().GetProperty("Cells") //returns null

有没有办法得到这张桌子?

相关问题 - 在Watch窗口(VS2008)中,常规属性有一个指向一张纸的手的图标。但是DataGridRow.Cells有一个指向一张纸的手的图标,左下角有一个小黄色信封 - 这是什么意思?

感谢您的回复。

2 个答案:

答案 0 :(得分:3)

如果您知道DataGrid名称,则可以通过索引获取任何Cell:

DataGridCell cell = dataGridName.Columns[columnIndex].GetCellContent(e.Row).Parent as DataGridCell;

答案 1 :(得分:0)

Cells属性是程序集的内部属性,因此您无法从代码中访问它。

相关问题