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

datagridview中DataGridViewComboBoxColumn 单击后引发事件解决思路

2012-01-06 
datagridview中DataGridViewComboBoxColumn 单击后引发事件DataGridView 控件,绑定了数据库,其中一列(假设

datagridview中DataGridViewComboBoxColumn 单击后引发事件
DataGridView 控件,绑定了数据库,其中一列(假设为col1)为 DataGridViewComboBoxColumn ,关联 Bit 类型数据,希望实现如下功能:
当单击col1列的CheckBox后,根据 CheckBox 是否打上勾,决定另一列(假设为col2)的值,如col1列为True,则Col2=1,Col1=false,则col2=0;且要立即在 DataGridView 中显示出来。

我试了CellValueChanged事件,要在点击之后,并离开该单元格后,才会触发事件,而CellContentClick事件更是莫名其妙。

不知道该用哪个事件?

[解决办法]
datagridview.endedit();

热点排行