【问题标题】:Get value of datagrid cell with given row index and column index获取具有给定行索引和列索引的数据网格单元格的值
【发布时间】:2011-10-06 10:01:36
【问题描述】:

我已经知道正确的行索引和列索引,但我不知道如何获取这两者的交集值。

【问题讨论】:

    标签: c# wpf datagrid


    【解决方案1】:

    这个怎么样:
    yourDataGrid[yourDataGrid.CurrentCell.RowNumber, whateverColumnIndex];

    【讨论】:

    • 它给了我错误:“无法使用 [] 将索引应用于“System.Windows.Controls.DataGrid”类型的表达式。
    • 我相信这个现在对你有用,dataGridView1[0, 0].Value.ToString();
    • 看看这个有用的链接msdn.microsoft.com/es-es/library/…
    • 抱歉,我没有使用 dataGridView。使用 DataGrid 我不能使用 []。
    猜你喜欢
    • 2012-09-28
    • 1970-01-01
    • 2013-06-24
    • 1970-01-01
    • 2012-11-14
    • 2016-08-28
    • 2013-06-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多