ge the parent datagridview from DataGridViewComboBoxEditingControl

I have a form with three dgvs and I have to create three separate functions to capture the index changed event of the combobox.  Is it possible to get the parent grid name from the function or control to be able to combine all three events in one sub event?  I've looked all the properties and methods and don't see anything in particular that would work.  Any ideas?
ddepuemdAsked:
Who is Participating?
 
abelConnect With a Mentor Commented:
They will point to the same object, but obviously, the EditingControlDataGridView is easier to use :)
0
 
abelCommented:
Though it might be necessary to see a code example before attempting to answer this, it sounds to me that what you are looking for is the .NamingContainer property, or the .NamingContainer.NamingContainer property (because you have layered grids).

In general, the NamingContainer, which returns an Object, can be cast to the type you expect it to be. Depending on where you are, you can do this recursively upwards, if your structure demands that.
0
 
ddepuemdAuthor Commented:
I found the answer it's the editingcontroldatagridview property.
0
All Courses

From novice to tech pro — start learning today.