Solved

ge the parent datagridview from DataGridViewComboBoxEditingControl

Posted on 2009-04-12
3
405 Views
Last Modified: 2012-05-06
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?
0
Comment
Question by:ddepuemd
  • 2
3 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24125785
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
 

Author Comment

by:ddepuemd
ID: 24125787
I found the answer it's the editingcontroldatagridview property.
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24125837
They will point to the same object, but obviously, the EditingControlDataGridView is easier to use :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create XML 5 46
Saveas need to save a copy 16 26
Put window Form inside tab page 10 26
Get size of each directory on each mapped drive 5 18
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now