<%@ Page language="c#" AutoEventWireup="false" %> SandGrid Documentation

SandGrid User Guide

Data Import and Export

Back to Table of Contents

Exporting Data

Tabular data can be displayed with so many methods it is useful to have a means of exporting it from controls such as SandGrid.

We support export of data to HTML tables which includes support for nested grids. Using the static DataUtilities.ExportToHtml method you can generate a string containing the HTML which can then be written to a file. The cell spacing and padding can optionally be specified.

Delimited text export is also supported and the static DataUtilities.ExportToDelimitedText method is all you need. Nested grids are not supported in this kind of data format. Parameters for specifying the delimiter character, string qualifier and other settings can be specified. There is also a DataUtilities.ExportToCsv method specially for exporting to CSV (comma-separated values) format.

Copying to the Clipboard

When the user presses Ctrl-C, SandGrid copies the selected rows or cells to the clipboard in tab-delimited format. This enables easy exchange between a SandGrid and applications like Excel. Programmatic access to these features is exposed through the static CopyCellsToClipboard and CopyRowsToClipboard methods of the ClipboardOperations class.

Pasting from the Clipboard

When the user presses Ctrl-V, SandGrid first looks for any CSV data in the clipboard. If some is found, the grid will intelligently distribute the data in cells in the grid, starting from the selected cells. If there is no CSV data and textual data is found, the textual data is simply inserted into the focused row or cell. In either case, the data is run through the normal parsing mechanism to prepare the individual values for insertion into the cells.

Next: Editing