【问题标题】:DataGridRow Cells propertyDataGridRow 单元格属性
【发布时间】:2010-03-24 09:54:52
【问题描述】:

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

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

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

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

感谢您的回复。

【问题讨论】:

    标签: visual-studio-2008 silverlight properties


    【解决方案1】:

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

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

    【讨论】:

    • 谢谢,Telerik 的网格有 Cells 属性,对于 sdk 的数据网格也可以。
    【解决方案2】:

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

    【讨论】:

    • 没有办法从事件中期望的代码中操纵它们吗?
    猜你喜欢
    • 2011-04-09
    • 1970-01-01
    • 2013-02-13
    • 1970-01-01
    • 2021-01-11
    • 2011-06-16
    • 2010-09-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多