日期:2014-05-18  浏览次数:20735 次

如何用反射得到IEnumerable里的某一个元素?
c1FlexGrid网格,
PropertyDescriptorCollection pd = TypeDescriptor.GetProperties(c1FlexGrid1);

PropertyDescriptor pdd = pd["Cols"];
object obj=pdd.GetValue(c1FlexGrid1);

到这里,得到了网格的Cols属性,但是怎么得到Cols[0]或Cols["列名"]呢?我现在只能得到Cols下的属性,如Count等。

Cols的最底层是IEnumerable

------解决方案--------------------
IEnumerable pdd = (IEnumerable)pd["Cols"]


类似