lhwyo
  • lhwyo
  • Newbie Topic Starter
2017-12-13T15:05:28Z
I am evaluating iGrid, using the demo version to determine whether to purchase.
So far it is very impressive and is far superior to Datagridview with the exception of one show-stopper.

The C# Datagridview has a "GetClipboardContent" method which creates a DataObject. It also employs ClipboardCopyMode to allow copying of header text.
I do not see equivalent functionality in iGrid. How can I copy the entire contents of iGrid to the clipboard (with the intention of sending to Excel).

In C#, using a Datagridview this can be accomplished with the following code:

datagrid1.ClipboardCopyMode = DataGridViewClipboardCopyMode.EnableAlwaysIncludeHeaderText;
datagrid1.SelectAll();
int gvcount = datagrid1.RowCount;
DataObject dataObj = datagrid1.GetClipboardContent();
if (dataObj != null)
Clipboard.SetDataObject(dataObj);


Have searched this forum and do not see anything like a concrete example.
Would very much appreciate any responses to reference C# instead of VB.

Many thanks
Igor/10Tec
2017-12-13T16:05:23Z
Our development policy is not to bloat iGrid by implementing many features that are not frequently used, and the requested copy-paste functionality is one of them. Moreover, there are many subtle things related to copy-paste. For instance, if you have a date or numeric value in a cell and it is formatted with a format string, what should be copied to the clipboard - the text representation of the value on the screen or the value itself in its native format?

But all this does not mean we can't provide a solution. We implemented an example of the copy-paste functionality for iGrid in the form of an extra sample with the full source code for possible further "fine tuning". You can download this sample named "Copy Paste Manager" from the online library of extra samples for iGrid here:

https://10tec.com/winforms-grid/extra-samples.aspx 

The copy-paste functionality is implemented in a separate class file that can be easily attached to your projects. The class provides your grids with some options like the context menu with the copy-paste commands and the ability to copy the column headers to the clipboard. You can even display two additional scroll bar buttons to select/deselect all grid cells. The functionality is implemented in two equivalent solutions in C# and VB.NET.

Perhaps, another sample named "Subtotal Manager with Export to MS Excel" will be also interesting for you. It demonstrates how to export the contents of iGrid into Excel via OLE Automation.