Usually when I add a control to a form using the Visual Studio GUI it writes all the code that defines the control is in a separate partial class file named ".Designer.CS". This partial class usually contains private fields for each control so the non-designer partial class can access the controls.
I've added a DataGridView in a GroupBox** to a Form. Yet a field is not being generated for the grid in the designer partial class. The control is being created correctly but no field is being defined that I can access the control from in my code.
I've tried changing the designer file so that the control is reference to a private field rather then a local variable. This works, yet I keep trying to edit the properties of the DataGridView through the Visual studio properties window, which ends up removing this field and breaking my code.
Is there a reason a private field is not setup for DataGridViews by Visual Studio in a form's designer partial class? How am I suppose to access the grid otherwise?