sheirali 0 Newbie Poster

Hello,
I have a very strange issue and am not sure why it is happening or how to prevent it.
Envionment:
.NET Framework 3.5
WinForm application
C#
VS2008 Pro

Issue:
I have a WinForm containing a TabControl which has a custom usercontrol on two of its TabPage.
The usercontrol i created contains 3 DataGridView controls.

Everytime I go into Desiger of my WinForm, I see that there are SIX (3 * 2) instances of a DataGridView control created.
They are all numbered such as dataGridView13, dataGridView14, etc...
Along each of those DataGridView instances, the associated DataGridViewTextBoxColumn and DataGridViewCellStyle instances are also created.
Pretty soon I had nearly 600 DataGridView instances in the MyWinForm.Designer.cs file!!


Why is this happening and more importantly how to prevent it???
Anyone has seen something like this before??

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.