Vikram

Vikram

  • 1.4k
  • 276
  • 308.3k

Two Combo Box in GridView

Jul 17 2012 12:54 AM
Hi,

  I have added two combo box column in grid view using code. Now I want to add change   value of second combo box on selected index change event of first combo box.

 Following is the code :

  private void dgv_EditingControlShowing(object sender,                                                                                        DataGridViewEditingControlShowingEventArgs e)
  { 
        if (e.Control is ComboBox)
        {
                ((ComboBox)e.Control).SelectedIndexChanged += new                                 EventHandler(UC_SelectedIndexChanged);    
        }
  }

 void UC_SelectedIndexChanged(object sender, EventArgs e)
 {
      // Here I get value of first Combo Box. I want to change values of second combo box          // according to the value of first combo box.       
 }

   Please tell me how to get DataRow and Second Combo box control in above event.
Any help appreciated.

 Regards,

 Vikram


Answers (2)