c# - 将 Infragistics UltraGridRow 转换为 DataRow

标签 c# infragistics datarow ultrawingrid

有没有一种简单的方法可以将基础设施 UltraGridRow 转换为标准 DataRow 对象?

最佳答案

如果您已将 UltraGrid 的 DataSource 设置为 DataTable,那么您可以使用

提取当前 ActiveRow 的底层 DataRow
 if(grid.ActiveRow != null && grid.ActiveRow.IsDataRow)
 {
      DataRow row = (grid.ActiveRow.ListObject as DataRowView).Row;
 }

当然,您可以将此示例的 ActiveRow 替换为 IsDataRow 属性为 true 的每个 UltraGridRow(注意 SummaryRows 和 OutlookGroupByRow)

请注意,如果您将 List<CustomClass> 绑定(bind)到 DataSource然后是 ListObject能够返回 CustomClass 的单个实例

关于c# - 将 Infragistics UltraGridRow 转换为 DataRow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18700866/

相关文章:

c# - Xamgrid 刷新或重新应用过滤器

asp.net-mvc-5 - 运行 Infragistics 树控件时对象不支持属性或方法 'igTree' 错误

c# - 获取 bindingSource 的 CurrentRow 的实例

c# - 从数据库表写入文本文件的最快方法是什么?

c# - 控制台应用程序中 WCF 托管服务中的 MaxReceivedMessageSize

javascript - 我只想选择当前页面的所有记录

c# - "' BaseClass ' does not contain a constructor that takes 0 arguments."部分 C#/Protobuf 类

vb.net - 比较数据行中的值 VB

c# - 字典<string,dynamic>的NEST映射获取空数组

c# - 更改网格中行的背景颜色