 ---------------------------------------------------
|                                                   |
| Copy Paste Manager                                |
|                                                   |
| iGrid.NET Extra Samples                           |
| Copyright (c) 10Tec Company                       |
| All rights reserved                               |
|                                                   |
| Available editions:                               |
| >> iGrid.NET 3.0, VS2008 C#/VB.NET                |
|                                                   |
 ---------------------------------------------------

Description:
============
In this example you can see how to implement copy/paste functionality in iGrid.NET by using the Excel clipboard format. This allows you to copy and paste the data inside one iGrid, between several iGrid's or between MS Excel and iGrid.

The functionality is implemented in one class called iGCopyPasteManager you can easily attach to your projects. The main feature list of this class is the following:

1) Cut/copy/paste functionality you can access through the keyboard (CTRL+X/CTRL+C/CTRL+V) or mouse (using a Cut/Copy/Paste context menu).

2) The additional ability to select or deselect all cells with the CTRL+A/CTRL+D keyboard commands or optional extra buttons on the vertical scroll bar.

3) The ability to optionally copy the column headers of the selected cells into the clipboard.

4) iGCopyPasteManager also allows you to work with non-rectangular selections available in iGrid.NET and hidden cells which can be automatically selected if the SelectInvisibleCells property is set to True.

5) To perform copy/paste actions from your code, you can also call the corresponding public methods of the iGCopyPasteManager class.


Short Code Explanation:
=======================
All the copy/paste functionality is implemented in one class called iGCopyPasteManager that can be easily attached to existing projects. To do that, add the iGCopyPasteManager.cs or iGCopyPasteManager.vb file to your project, declare an object variable of the iGCopyPasteManager type and attach it to the required grid passing a reference to the grid in the constructor of the class:

*** C# ***

// Declaration
public partial class Form1 : Form
{
   ...
   private iGCopyPasteManager fCopyPasteManager;
   ...
}

// Initialization
private void Form2_Load(object sender, EventArgs e)
{
   ...
   fCopyPasteManager = new iGCopyPasteManager(fGrid);
   ...
}

*** VB.NET ***

' Declaration
Public Class Form1
   ...
   Private fCopyPasteManager As iGCopyPasteManager
   ...
End Class

' Initialization
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
   ...
   fCopyPasteManager = New iGCopyPasteManager(fGrid)
   ...
End Sub

That's all. After that the specified grid will support all the main features of this copy/paste manager class described above.

The cells are passed into the clipboard in the standard string representation used in such apps as MS Excel: each cell in a row is separated with the tabulation symbol, and each row of cells is separated with the new line/carriage return symbols.


Change List:
============
** 2011-Nov-23 **
1) The iGCopyPasteManager class was improved to support iGrids with row mode turned on.
2) The sample projects were converted to use the latest available iGrid (3.0).
3) The sample projects were converted into the VS2008 file format.

