Focus

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

 

代码
       private void dataGrideTextProp_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            
if (dataGrideTextProp.CurrentCell.ColumnIndex == 1 && dataGrideTextProp.CurrentCell.RowIndex != -1)
            {
                (e.Control 
as ComboBox).SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
            }
        }

        
void ComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox comboBox 
= sender as ComboBox;
            
//干自己的事情
             
//
            comboBox.SelectedIndexChanged -= new EventHandler(ComboBox_SelectedIndexChanged);
            
//System.Threading.Thread.Sleep(500);
            
//comboBox.Hide();
        }

 

 

posted on 2010-12-03 09:43  Y1  阅读(1178)  评论(0编辑  收藏  举报