Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ge the parent datagridview from DataGridViewComboBoxEditingControl

Posted on 2009-04-12
3
Medium Priority
?
418 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 2000 total points
ID: 24125837
They will point to the same object, but obviously, the EditingControlDataGridView is easier to use :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Loops Section Overview

971 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