Spread Windows Forms 8.0 Product Documentation > Developer's Guide > Customizing Sheet Interaction > Setting and Resetting User Interaction > Resetting Parts of the Interface |
You can reset various settings on various parts of the Spread component interface back to default or original values. You can also clear parts of the data area of various items, both data and formatting.
The ways in which parts of the component can be reset include:
Reset the settings for cells, rows, or columns using the individual reset methods for each setting in the Cell or Row or Column class:
Resetting Desired |
Method Name |
---|---|
background color for individual cells or for row or column of cells |
ResetBackColor |
border for individual cells or for row or column of cells |
ResetBorder |
cell type for individual cells or for row or column of cells |
ResetCellType |
text font for individual cells or for row or column of cells |
ResetFont |
foreground color for individual cells or for row or column of cells |
ResetForeColor |
row height |
ResetHeight |
cell contents horizontal alignment for individual cells or for row or column of cells |
ResetHorizontalAlignment |
cell header label |
ResetLabel |
locked status for individual cells or for row or column of cells |
ResetLocked |
merge policy for a row or column of cells |
ResetMergePolicy |
cell note indicator color for individual cells or for row or column of cells |
ResetNoteIndicatorColor |
parent style name for individual cells or for row or column of cells |
ResetParentStyleName |
column resizable |
ResetResizable |
column sort indicator |
ResetSortIndicator |
cell contents vertical alignment for individual cells or for row or column of cells |
ResetVerticalAlignment |
row or column visible |
ResetVisible |
column width |
ResetWidth |
Reset all the named style properties to their default values using the NamedStyle class Reset method. There are also individual reset methods for each of the settings in a style:
Method Name |
Resetting Desired |
---|---|
Reset |
all the properties of the style |
ResetBackColor |
background color of a cell |
ResetBorder |
border around a cell |
ResetCanFocus |
whether the cell can receive focus |
ResetCellType |
cell type of the cell |
ResetEditor |
editor used for editing the cell |
ResetFont |
font face used in the text of the cell |
ResetForeColor |
text (foreground) color in a cell |
ResetFormatter |
formatter for formatting the contents of the cell |
ResetHorizontalAlignment |
horizontal alignment of text in a cell |
ResetLocked |
whether the cell is marked as locked |
ResetName |
default name of the style |
ResetNoteIndicatorColor |
color of the cell note indicator |
ResetNoteStyle |
cell note style |
ResetParent (Inherited from StyleInfo) |
parent style name |
ResetProperty |
specified setting property |
ResetRenderer |
renderer for painting the cell |
ResetTabStop |
whether the user can set focus to the cell using the Tab key |
ResetVerticalAlignment |
vertical alignment of text in a cell |
If you are setting the background color for an individual cell, then ResetBackColor resets that cell's background color to its default color. If, instead, you set the background color using the BackColor property for a Row object, then you must use the ResetBackColor for that Row. If you want to loop all the cells setting the color to White, you can speed this up by invalidating the painting in the Spread while you are looping the cells.
FpSpread1.SuspendLayout()
FpSpread1.Sheets(0).Cells(0, 0, 499, 499).BackColor = Color.White
FpSpread1.ResumeLayout(True)
Resetting the component or a sheet to its default settings returns the component or the sheet to its initial state prior to any design-time or run-time changes. It clears data, resets colors, and returns cells to the default cell type. Resetting the component resets everything in the component to the state when the component is first drawn on the form.
Note: Resetting the component or a sheet clears the data in the sheet(s) as well as the formatting. If you provide a way for users to reset their sheet(s), be sure to have them confirm the action before resetting the sheet(s).
You can find out the default size of the component using the FpSpread DefaultSize property.
For more information about clearing data, refer to Removing Data from a Sheet.
For information on resetting values creating during the design using Spread Designer, refer to explanation of this procedure in the Spread Designer Guide.