This project is read-only.

Error

Mar 27, 2009 at 10:07 PM
Hi all,
Does anyone know how to fix this error?
Error 2 'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableAutoSize' and no extension method 'EnableAutoSize' accepting a first argument of type 'System.Windows.Forms.AutoSizeMode' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\User\Desktop\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids\GridVirtual.cs 262 53 SourceGrid2

Thanks
M
Mar 28, 2009 at 10:56 PM
What do you want to achieve?

This is a normal compiler error, which tells you that probably a method called "EnableAutoSize" does not exist in type System.Windows.Forms.AutoSizeMode
Mar 29, 2009 at 9:03 AM
I am just trying to compile and run the downloaded source.

All I am doing is playing around to see for myself what this is capable of.

If this is a normal comiler error, how do you use this library?  I cannot see the code at the moment but I believe there is a form in the downloaded source which uses the SourceGrid...(maybe wrong but this is only from memory!!) so would like a runnable example.

Thanks
M
Mar 29, 2009 at 2:11 PM
where did you download source code?  Trunk and SourceGrid 4.20 are compiling without any errors
Mar 29, 2009 at 5:56 PM
I downloaded SourceGrid from CodePlex.

I tried using Visual C# Express - this shouldn't be a problem should it?  What do you use?

Mar 29, 2009 at 8:40 PM
I use SharpDevelop, and both trunk and 4.20 versions compile fine.

Did you modify the code you've downloaded?
Mar 29, 2009 at 9:35 PM
Out of curiousity I downloaded SharpDevelop to see if I had any better luck (and to see how it compared to other IDEs).

SharpDevelop will not even open the solution file:  I get an error saying "Can't read Microsoft solution file format 10.00"

I'm not doing too well, am I? ;)
Mar 31, 2009 at 7:45 PM
Well, that's really strange, because i use SharpDevelop  3.0.0 Build 3683 ant everything works fine. Which SharpDevelop version are you using?
Apr 1, 2009 at 7:25 PM
Unfortunately I uninstalled SharpDevelop before looking at the build as it didn't work.  It is the latest one downloadable from their website.
Apr 2, 2009 at 5:30 AM
Well, than i don't know how to help you, i need concrete information to be able to diagnose the problem. The compiler error you get is simple, and you probably got this after modifying the souce code.

Please ask if you have any further questions.
Jul 2, 2009 at 5:57 AM
Edited Jul 2, 2009 at 5:57 AM

Hello,

I apologize for resurrecting this thread, but I feel like it is better than starting a new one for the same (I believe) issue.

---

System: Windows XP Pro SP3,

Framework: .net 3.5

IDE: SharpDevelop 3.1.0

SourceGrid Release: 4.21

---

Errors:

--------

263  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableAutoSize' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
263  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableAutoSize' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
301  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableAutoSize' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
301  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableAutoSize' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
441  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
441  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
450  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
450  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
472  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
472  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
481  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids 
481  'System.Windows.Forms.AutoSizeMode' does not contain a definition for 'EnableStretch' (CS0117)  GridVirtual.cs  C:\Dev\!SandBox\cSharp\SourceGrid2_Source\SourceGrid2\SourceGrid\Grids

---

No modifications to source.  Only unrared the source and tried to compile.

I will be fine referencing the dll in my project, but I like to tinker and got thiese errors when I tried to compile.

 

BTW, thank you very much for such a great project!  I look forward to using this in a lot of little projects of my own for family and friends.

 

E

Jul 2, 2009 at 6:17 AM

Okay, I already resolved the issue.

Changed the lines in GridVirtual.cs where AutoSizeMode.EnableAutoSize and AutoSizeMode.EnableStretch produced the errors above to

SourceGrid.AutoSizeMode.EnableAutoSize and SourceGrid.AutoSizeMode.EnableStretch respectively.

Now it compiles fine ;-)

 

Thanks again for this great resource!

E.