Spread Windows Forms 18 Product Documentation / Developer's Guide / Customizing Row or Column Interaction / Copying Size and Style of Row/Column on Insert
In This Topic
Copying Size and Style of Row/Column on Insert
In This Topic

Spread allows you to copy width, height and style settings from a previous row/column whenever a new row/column is inserted in existing rows/columns. This feature works only when LegacyBehaviors.Style is excluded from LegacyBehaviors enum.

Copying of style and size settings applies only when a new row/column is inserted by following methods:

The following images illustrates that the inserted row has copied the size and style settings from previous row.

Image showing the insert option in context menu

      Image showing the size and style of row is copied while inserting a new row

To insert new rows/columns using context menu at runtime, use the following code.

C#
Copy Code
// Context menu appears at runtime
fpSpread1.ContextMenuStrip = new SpreadContextMenuStrip();
VB
Copy Code
' Context menu appears at runtime
FpSpread1.ContextMenuStrip = New SpreadContextMenuStrip()

For inserting new rows/columns using keyboard shortcut keys (Ctrl Shift +), you have to enable the ExcelCompatibleKeyboardShortcuts option. To do this, use the following code.

C#
Copy Code
// Excel compatible shortcut keys will be enabled at runtime
fpSpread1.Features.ExcelCompatibleKeyboardShortcuts = true;
VB
Copy Code
' Excel compatible shortcut keys will be enabled at runtime
FpSpread1.Features.ExcelCompatibleKeyboardShortcuts = True
This feature does not affect inserting rows/columns using the InsertRows and the InsertColumns methods at runtime.
See Also