Okay so i have this variable
private System.Windows.Forms.DataGridView dgdisplay;
then when i add
this.Controls.Add(this.dgdisplay);
in the InitializeComponent() function it works just fine.
But when i change dgdisplay to:
private System.Windows.Forms.DataGridView [] dgdisplayX = new System.Windows.Forms.DataGridView [3];
and add this line in InitializeComponent():
dgdisplayX[0]=new System.Windows.Forms.DataGridView();
and change all the previous dgdisplay to dgdisplayX[0]
And change the Controls.Add() to:
this.Controls.Add(this.dgdisplayX[0]);
I get this error when switching to design mode:
Failed to load designer. Check the source code for syntax errors and check if all references are available.
ICSharpCode.FormsDesigner.FormsDesignerLoadException: System.ComponentModel.Design.Serialization.CodeDomSerializerException: The variable 'viewx' is either undeclared or was never assigned.
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadDesigner()
at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadAndDisplayDesigner()
at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadInternal(OpenedFile file, Stream stream)
at ICSharpCode.SharpDevelop.Gui.AbstractViewContentHandlingLoadErrors.Load(OpenedFile file, Stream stream)
What really stress me out is that the solution compile just fine . no problem at all. I've tried cleaning the solution,rebuild and recompile to check for errors. but still no errors.
Anyone? I've tried searching in google but i can't find anything.