foamy
October 23rd, 2008, 04:24 AM
Hi guys,
One of my applications contains a large datagridview, which is updated every 5 seconds to show data. I have set it up with a selection of columns and have databound it programmatically. In the form's constructor I execute this statement:
grid.AutogenerateColumns = false;
This should prevent the datagridview from showing any other columns than the ones I have defined at design time.
And it does, when the application runs on a Vista machine. As soon as I run it on an XP machine, the datagridview generates the columns anyway.
The datasource is an ArrayList containing custom objects. The objects are of a simple reference type called Customer and they contain the generic properties we all know and love (ID, Name etc.)
I found a solution to this problem. If I put the above statement in the .Designer.cs file, it works on XP. No matter where I put it other than in there, it won't work. It works on Vista either way...
Can someone please explain this behavior? 'Cos I'm thoroughly stumped!
One of my applications contains a large datagridview, which is updated every 5 seconds to show data. I have set it up with a selection of columns and have databound it programmatically. In the form's constructor I execute this statement:
grid.AutogenerateColumns = false;
This should prevent the datagridview from showing any other columns than the ones I have defined at design time.
And it does, when the application runs on a Vista machine. As soon as I run it on an XP machine, the datagridview generates the columns anyway.
The datasource is an ArrayList containing custom objects. The objects are of a simple reference type called Customer and they contain the generic properties we all know and love (ID, Name etc.)
I found a solution to this problem. If I put the above statement in the .Designer.cs file, it works on XP. No matter where I put it other than in there, it won't work. It works on Vista either way...
Can someone please explain this behavior? 'Cos I'm thoroughly stumped!