This project is read-only.

To be able to execute the samples, please:

  • Go here and download the latest sources.
  • Unzip the file.

 

At the location of the extraction, you will find the two following solutions:

EasyToolkit.sln  : this solution is for Visual Studio 2010.  

image

  • In the ‘Tests/Excel’ folder, you have the projects:

    • ExcelVsto2007Test (for those that have Excel 2007 installed).
    • ExcelVsto2010Test (for those that have Excel 2010 installed).
  • The two samples are built with the VSTO 2010 runtime (for more information on Vsto). If you don't have it, please download and install it.

 

EasyToolkitVS2012.sln : this solution is for Visual Studio 2012:

Untitled

 

Sample overview:

All the sample projects can be executed with Excel 2007, 2010, 2013 (In an undifferentiated manner).

All workbook samples are composed in the same way.

  • 4 sheets:
    • 'Template Customer 1': contains the templates used to render the sheet 'Customer Sample 1'.
    • 'Template Customer 2': contains the templates used to render the sheet 'Customer Sample 2'(.
    • 'Customer Sample 1': contains nothing. It's used to render a view of the template 'Customer1' from the sheet 'Template Customer 1'. 
    • 'Customer Sample 2': contains nothing. It's used to render a view of the template 'Customer2' from the sheet 'Template Customer 2'. 

 

  • The 'Excel Toolkit Test' tab :

Untitled

    • ‘Render All’ : Rerender all views of the workbook (structure and data).
    • ‘Render Data Only’: Rerender only the data of all views of the workbook (only the data. The structure of the data are not supposed to have changed). Quicker than ‘Render All’.
    • ‘Clear Views’: Clear all views of the workbook.
    • ‘Reload All Templates’: Reload all the templates and rerender all views of the workbook.   

 

  • The following ‘Action Pane’:

Untitled

This pane (written in WPF, located in ‘Tests\EasyToolkit.Test.Data.Service\UI’) is here to show the effects of ‘INotifypropertyChanged’ for the application.

 

Using the sample :

  • Go to the sheet ‘Customer Sample 1’

Untitled

If you try to modify the cells, we will see that only the values in the columns ‘Unit Price’, ‘Quantity’ and ‘Discount (%)’ (for the line that have one) will accept the changes (and any changes on these cells will affect the cells in the column ‘Price’).

  • Now, go the sheet ‘Template Customer 1’ (the sheet that contains the template used by the view of the sheet ‘Customer Sample 1’).

For more information about how to manage templates please  go here) 

image

    • Look at the cells containing  the values ‘{R:Forename}’ and ’{R:Surname}’
      • ‘{}’ indicates that the cells contain binding definitions.
      • ‘R:’ says that the binging definition is ‘One-Way’  (read only):  in the view the user cannot change the value of these cells.
      • ‘Forename’ and ‘Surname’ are the name of the properties to bind with. These properties are member of the class ‘Customer’ of the assembly 'EasyToolkit.Test.Data.Service’: this class is defined to be the root type of this template (as set in the cell ‘Options’) .
    • Change the contain of the cells from ‘{R:Forename}’ and ’{R:Surname}’ to ‘{Forename}’ and ’{Surname}’ (as these properties have their ‘getter’ and ‘setter’ and as you remove the ‘R:’ the cells are not read only anymore).
  • In The 'Excel Toolkit Test' tab, click on the ‘Reload All Templates’ button.
  • Now, go back to the sheet ‘Customer Sample 1’.
    • Try to modify some values in the column ‘Forename’ or ‘Surname’: Excel now accepts it (and the changes will also impact the cell ‘Name’ just beside).

 

  • Now, go to the ‘Action Pane’ (shows the effects of ‘INotityPropertyChanged’)
    • Choose a customer and an order.
    • In the list below, change either an ‘Unit Price’ or a ‘Quantity’.
    • On the template view, check, for the corresponding ‘customer’ and ‘order’, that  the ‘Unit Price’ or the ‘Quantity’ and the ‘Price’ are reflecting the changes.

Untitled

    • On the view, change either an ‘Unit Price’ or a ‘Quantity’.
    • Check on the ‘Action Pane’, for the corresponding ‘customer’ and ‘order’, that  the ‘Unit Price’ or the ‘Quantity’ and the ‘Price’ are reflecting the changes.

 

 

More to come …

Last edited Jan 6, 2014 at 9:07 PM by Rbl, version 5