FIRST POST! Been lurking for years, but Googling on this issue hasn't turned up any results. So here goes...
I have several C# WinForms apps exhibiting this behavior in Visual Studio 2008, but I think I noticed this same problem back when I was working with Visual Studio 2005 as well. The main form contains a tab control, and on several sub-tabs I have a few DataGridView control. I used the designer to add and customize all columns.
The only thing I've customized about these columns is their HeaderText, MaxInputLength, and Name. In this case I'm working with numeric entries, so I modified one thing under the DefaultCellStyle, "Alignment=TopRight" (replacing "NotSet") to display numeric entries properly.
So here's the problem. Every so often as I'm checking in code changes from elsewhere in my main form, such that FormMain.Designer.cs is modified, I see something has magically renumbered my DataGridViewCellStyle variable names!
All throughout FormMain.Designer.cs, anywhere I previously had "dataGridVewCellStyle1" has been renamed to "dataGridViewCellStyle3", and my variable numbered 2 has been renumbered to 4. Like so:
dataGridViewCellStyle1 -> dataGridViewCellStyle3
dataGridViewCellStyle2 -> dataGridViewCellStyle4
Once I had a project with about 8 different customized cell styles, and every so often they were all renumbered magically by something I saw doing elsewhere on that form. After several check-ins, the numbers were up in the 50's and 60's. None of those cell styles were modified; they just got renumbered.
This is more annoying than anything. Have any of you seen this too, do you know if there's a pattern, what what can I do about it?
Thanks in advance!