首页 > 解决方案 > Accessing array of child objects in c#

问题描述

I am having a scenario like the following in datagridView - CellPaintingEvent

object cellValue = e.FormattedValue;

through the above sequence i am getting array of values sometimes i.e:

cellValue = system.object[];

pls let me know how to access all those child objects value.

Thanks in advance

标签: c#

解决方案


CellPainting 事件适用于具有单个值的单个单元格。FormattedValue 不是数组。你查过 MSDN 吗?他们有一些示例如何使用事件和 DataGridViewCellPaintingEventArgs:

DataGridViewCellPaintingEventArgs

格式化值


推荐阅读