如何给DataGridViewComboBoxColumn写事件
展开全部
privatevoidhpGridView1_EditingControlShowing(objectsender,DataGridViewEditingControlShowingEventArgse){//判断要处理的DataGridViewComboBoxColumn名称,若符合条件,编辑控件被强制转换为ComboBox以处理,添加SelectedIndexChanged事件if(this
.hpGridView1.CurrentCell.OwningColumn.Name=="clmTest"){
((ComboBox)e.Control).SelectedIndexChanged+=newEventHandler(ComboBox_SelectedIndexChanged);}}///
<summary///SelectedIndexChanged事件触发时需要进行的处理///
</summary///
<paramname="sender"</param///
<paramname="e"</paramprivatevoidComboBox_SelectedIndexChanged(objectsender,EventArgse){this
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询