【问题标题】:How to get cell value from expanded gridview row如何从扩展的gridview行中获取单元格值
【发布时间】:2013-11-20 13:17:22
【问题描述】:

如何从绑定到另一个表的展开的详细信息行中获取单元格值?

string name = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "colName").ToString())

不起作用,因为:列“colName”不属于表“用户”。

【问题讨论】:

  • 错误很明显..Column 'colName' does not belong to table 'Users'

标签: c# gridview devexpress


【解决方案1】:

您应该使用带有详细视图而不是主视图的GetRowCellValue 方法:

GridView detailView = gridView1.GetDetailView(gridView1.FocusedRowHandle, 0) as GridView;
string name = (string)detailView.GetRowCellValue(detailView.FocusedRowHandle, "colName");

请查看Navigating Through Master and Detail Rows帮助文章了解更多详情。

相关帮助文章:Master-Detail Overview

【讨论】:

    猜你喜欢
    • 2021-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-01-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多