SpreadsheetGear 2010 comes with the SpreadsheetGear Explorer sample solutions which are helpful Windows Forms applications for Visual Studio 2005. Visual Studio 2008 and Visual Studio 2010 will offer to convert these solutions to Visual Studio 2008 / 2010 solutions the first time they are opened.
The SpreadsheetGear Explorers are available with C# and Visual Basic source code and are composed of a set of user controls, each of which demonstrates commonly used SpreadsheetGear 2010 functionality and API's. Source code can be viewed and copied directly from the source viewer below each sample. Follow the steps below to open and run the SpreadsheetGear Explorer solutions from Windows (requires a version of Visual Studio 2005, Visual Studio 2008 or Visual Studio 2010 which supports Windows Forms solutions and either C# or Visual Basic).
Please see Troubleshooting SpreadsheetGear Explorer below if you are having problems running the samples.
Running the SpreadsheetGear Explorer Sample Solutions
- Install SpreadsheetGear 2010.
- To open the SpreadsheetGear Explorer Sample solution in Visual Studio, open the Windows Start menu, click on All Programs, click on SpreadsheetGear 2010 and click on SpreadsheetGear Explorer C# Sample or SpreadsheetGear Explorer VB Sample.
- If you are opening the solution in Visual Studio 2008 or Visual Studio 2010 for the first time, follow the steps in the Visual Studio Conversion Wizard to convert the solution to Visual Studio 2008 / 2010.
- For the best performance, make sure that the current configuration is set to Release rather than Debug.
- Open the Build menu and choose Rebuild Solution.
- Open the Debug menu and choose Start Without Debugging to run SpreadsheetGear Explorer.
- In SpreadsheetGear Explorer, choose among the various samples on the left. Note that many of the samples require user input, such as clicking on a Run Sample button or entering the specified text or number into a cell.
- Source code can be viewed and copied directly at runtime from the source viewer below each sample.
- It is important to note that the SpreadsheetGear Explorer samples demonstrate the usage of GetLock and ReleaseLock which are required when using the WorkbookView control with background calculation enabled. ASP.NET developers will almost never use GetLock and ReleaseLock, and at the time of this writing none of the ASP.NET samples provided by SpreadsheetGear LLC use GetLock and ReleaseLock.
Troubleshooting SpreadsheetGear Explorer
You may run into problems with the SpreadsheetGear Explorer samples. Common problems fall into one of two categories:
- You have insufficient permissions to modify the SpreadsheetGear Explorer sample solutions and source files. This is particularly likely when running Windows Vista or Windows 7 with User Access Control (UAC) enabled. If this is the case, you may not be able to successfully run the Visual Studio 2008 or Visual Studio 2010 Conversion Wizard and modify the SpreadsheetGear Explorer sample source files.
- You have a version of the Visual Studio 2005 IDE installed but it does not support the C# Windows Forms projects and / or VB Windows Forms projects. This is the case with some of the Visual Studio 2005 Express versions as well as some 3rd party software which installs a limited version of the Visual Studio 2005 IDE.
To avoid these problems, run an appropriate version of Visual Studio as an administrator.
Running Visual Studio 2005, Visual Studio 2008 or Visual Studio 2010 as an Adminstrator
- Open the Windows Start menu, click on All Programs and then click on Microsoft Visual Studio 2005, Microsoft Visual Studio 2008 or Microsoft Visual Studio 2010.
- Right click on the Microsoft Visual Studio 2005, Microsoft Visual Studio 2008 or Microsoft Visual Studio 2010 command and click Run as Adminstrator.
- Click Yes at the User Access Control prompt to allow Visual Studio to make changes to the computer.
- In Visual Studio, open the File menu, then open the Open menu, and then click on Project/Solution...
- If you are running Windows Vista or Windows 7, navigate to 'C:\ProgramData\SpreadsheetGear\SpreadsheetGear 2010\Samples\' and then open either WindowsSamples\WindowsSamples.sln for the C# samples or WindowsSamplesVB\WindowsSamplesVB.sln for the VB samples.
- If you are running Windows XP or earlier versions of Windows, navigate to 'C:\Documents and Settings\All Users\Application Data\SpreadsheetGear\SpreadsheetGear 2010\Samples\' and then open either WindowsSamples\WindowsSamples.sln for the C# samples or WindowsSamplesVB\WindowsSamplesVB.sln for the VB samples.
- Go to step #3 above under Running the SpreadsheetGear Explorer Sample Solutions.
As an alternative, you may prefer to copy the samples from 'C:\ProgramData\SpreadsheetGear\SpreadsheetGear 2010\Samples\' (or 'C:\Documents and Settings\All Users\Application Data\SpreadsheetGear\SpreadsheetGear 2010\Samples\' on older versions of Windows) to a directory in which you have the appropriate permissions and then open them in Visual Studio.