GridView中单元格的奇怪问题
我自己写了一个类DataGridViewMultDicComboBoxCell,继承自DataGridViewComboBoxCell。内部定义了一个私有成员: private int index = 0;
并重写了方法GetFormattedValue:
protected override object GetFormattedValue(object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context)
{
index++;
...
}
照道理说每一列的单元格是一个单独的对象,其拥有的私有成员index也是相互独立的,但是该列的上下单元格的index值却是共享的。
想问问达人,这是什么原因? --------------------编程问答-------------------- 上下单元格index可能指的是列的index,你要看清楚了 --------------------编程问答--------------------
很有可能。。。列的就是一样的。
补充:.NET技术 , C#