C # VS2008 - why are DataGridViewCellStyle variables automatically renamed?

FIRST MAIL! Has been hiding for many years, but Googling on this issue did not bring any results. So here goes ...

I have several C # WinForms applications that demonstrate this behavior in Visual Studio 2008, but I think I noticed the same problem when working with Visual Studio 2005. The main form contains a tab control, and on several sub-tabs I have There are several DataGridView controls. I used the constructor to add and customize all columns.

The only thing I configured in these columns is HeaderText, MaxInputLength and Name. In this case, I work with numeric entries, so I changed one thing in DefaultCellStyle, "Alignment = TopRight" (replacing "NotSet"), to display the numeric entries correctly.

So here is the problem. Every time I check for code changes elsewhere in my main form, so that FormMain.Designer.cs is changed, I see that something has magically renumbered my DataGridViewCellStyle variable names!

Throughout FormMain.Designer.cs, somewhere earlier I had "dataGridVewCellStyle1", it was renamed to "dataGridViewCellStyle3", and my variable number 2 was renumbered to 4. Also:

dataGridViewCellStyle1  ->  dataGridViewCellStyle3
dataGridViewCellStyle2  ->  dataGridViewCellStyle4

8 , , . 50 60- . ; .

, -. - , , , ?

!

+3

All Articles