Title: Accessing 2 separate gridview's data in a button's click event
Tags: c#;events;gridview
Question: I'm new to C# (mostly do SQL development) and I'm having trouble getting my head around .net events and how to bring it all together. I have a form that looks roughly like this:
gridView1
gridView2     btn_Addpoint
gridView3     btn_RemovePoints
So on my form I have 3 Gridcontrols, the top one has the parent rows and the second one has the children. Then I have 2 buttons that can either add selected points from the 2nd grid to the 3rd grid and the remove button to remove them from the 3rd grid.
So when I add the button click event I have this:
btnAddPoint_Click(object sender, EventArgs e)
I understand the sender is the actual button and I have googled a bit and discovered the Tag property to create a pointer to one of the grids which you can Cast inside this button event to access the actual grid but it seems like it can only have 1 Tag so what about my other 2 grids?
The whole purpose is to check whether duplicates are added and I also need to change the colour of some of the rows based on conditions.
How do I "see" all 3 grids inside the 2 button events to get access to their rows? Should I make them global variables and somehow update them using events or setup a relationship somehow? I just need to be steered in the right direction here of what to do / what the best practise is, but some code would also be appreciated.

Here is the accepted answer: If the controls are all on the same form with the button event handler you can access the grids via the name you give them in the designer (or if you haven't named them they will be datagridview1, datagridview2, datagridview3).
(Would have posted as a comment but not got the "rep" yet)


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:09/25/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><events><gridview>', 'Title': "Accessing 2 separate gridview's data in a button's click event", 'ViewCount': 263, 'id': 18999682, 'user_AboutMe': '', 'user_AccountId': 3349720.0, 'user_DisplayName': 'PretoriaCoder', 'user_Reputation': 661.0, 'user_Views': 42.0, 'user_id': 2813989.0}}