Answered Reach dataGridView within a user controller?

bondra

Well-known member
Joined
Oct 24, 2020
Messages
77
Programming Experience
Beginner
I'm trying to reach dataGridView1 which is in a user controller.
Syntax below is wrong.... any ideas what the correct one is? :)

C#:
userControlListAnimals1.dataGridView1.DataSource = Pets;
 
You are breaking the Law of Demeter. Just tell the user control what data source you want it to use, and let the user control take care of passing it on to it's data grid view.

 
Back
Top Bottom