【发布时间】:2008-11-05 10:22:54
【问题描述】:
在绑定到 DataView 的 DataGridView 中,列中的单元格将包含 ImageList 中的两个图像之一(例如绿色的“在线”图像或红色的“离线”图像),您如何计算出现次数遍历 DataGridView 的行时的每个图像?
DataGridViewImageCell 的 Value 和 FormattedValue 属性返回不同的引用,即使基础 DataTable 中的条目是通过引用 ImageList 中的相同 Image 创建的。
因此,与其计算 4 次“在线”和 6 次“离线”,我得到了 10 次据称不同的图像。
【问题讨论】:
标签: c# winforms datagridview