首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

Winform DataGridViewCheckBoxColumn解决方法

2012-06-20 
Winform DataGridViewCheckBoxColumnC# code for (int i 0 i cGoods.Rows.Count i++){object obj

Winform DataGridViewCheckBoxColumn

C# code
 for (int i = 0; i < cGoods.Rows.Count; i++)                    {                        object obj = cGoods.Rows[i].Cells[0].Value;                        if (obj.ToString().Equals("1")&&obj!=null)                        {                            int id = Convert.ToInt32(cGoods.Rows[i].Cells[2].Value.ToString());                        }                    }

cGoods里面的DataGridViewCheckBoxColumn 的FaslseValue="0",TrueValue="1",IndeterminateValue = "0";
在DataGridViewCheckBoxColumn没选中的情况下取回来的值都是null 困扰了我一个早上了 求助各位大侠。。。

[解决办法]
"True" == cGoods.Rows[i].Cells[0].EditedFormattedValue.ToString()

是不是这个意思啊

热点排行