Spread 8.0 Documentation
Example
Support Options

Glossary Item Box

Example


The following example provides text for the column headers, sets the maximum number of columns, sets the sheet to remain in edit mode, and allows the user to move an entire row by dragging and dropping it.

In the following figure, the user has moved the second row to become the fourth row.

C++

// Provide text for the column headers
// Specify clipping block
m_Spread.SetCol(1);
m_Spread.SetCol2(4);
m_Spread.SetRow(0);
m_Spread.SetRow2(0);
// Clip data into the sheet
m_Spread.SetClip ("Transaction\tAssets\tLiabilities\tEquity");

// Set the maximum number of columns
m_Spread.SetMaxCols(4);

// Set the column width for all columns
m_Spread.SetColWidth(-1,10);

// Allow the user to drag and drop an entire row
// Set the drag and drop operation
m_Spread.SetAllowDragDrop(TRUE);
// Set the sheet to select an entire row
m_Spread.SetOperationMode(OperationModeRow);

// Set the sheet to always use edit mode
m_Spread.SetEditModePermanent(TRUE);

Visual Basic

' Provide text for the column headers
' Specify clipping block
fpSpread1.Col = 1
fpSpread1.Col2 = 4
fpSpread1.Row = 0
fpSpread1.Row2 = 0
' Clip data into the sheet
fpSpread1.Clip = "Transaction" + Chr$(9) + "Assets" + Chr$(9) + "Liabilities" + Chr$(9) + "Equity"

' Set the maximum number of columns
fpSpread1.MaxCols = 4

' Set the column width for all columns
fpSpread1.ColWidth(-1) = 10

' Allow the user to drag and drop an entire row
' Set the drag and drop operation
fpSpread1.AllowDragDrop = True
' Set the sheet to select an entire row
fpSpread1.OperationMode = OperationModeRow

' Set the sheet to always use edit mode
fpSpread1.EditModePermanent = True

Copyright © GrapeCity, inc. All rights reserved.