2011-12-14 123 views
0

我正在尋找的事件,讓你知道,組合框在DataGridView中已經改變:(組合框更改事件

+0

是您正在尋找的客戶端事件或服務器端事件? – kvc 2011-12-14 20:07:01

+0

更好的問題是這個問題與哪個框架有關? – 2011-12-15 03:20:59

回答

0

我假設你下尋找這個WinForm的

ComboBoxDataGridView是可用的編輯控制,你可以通過訂閱的EditingControlShowing事件的DataGridView

private void mygrid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) 
{    
      if (colName == "reqdcolname") 
      { 
       ComboBox cmbox = e.Control as ComboBox; 
       if (cmbox != null) 
       { 
        //subscribe for combobox events as you require 
        cmbox.SelectedIndexChanged -= new EventHandler(cmbox_SelectedIndexChanged); 
        cmbox.SelectedIndexChanged += new EventHandler(cmbox_SelectedIndexChanged); 
        //since it would be call for each combobox cell subscribe in this fashion 
       } 
      } 
} 
掛鉤對同一事件

如果情況並非如此,請更新相關問題的相關細節。 }