You can set the row height or column width as a specified number of pixels. Each sheet uses and lets you set a default size, making all rows or columns in the sheet the same size. You can override that setting by setting the value for individual rows or columns.
Users can change the row height or column width by dragging the header lines between rows or columns.
For more details refer to the Column.Width method or Row.Height method.
Using the Properties Window
- At design time, in the Properties window, select the Spread component.
- Select the Sheets property.
- Click the button to display the SheetView Collection Editor.
- In the Members list, select the sheet for which to set the column width for a column.
- In the properties list, set the Columns property and then click the button to display the Cell, Column, and Row Editor.
- Click the column heading of the column for which you want to set the width.
- In the properties list, set the Width property.
- Click OK to close the Cell, Column, and Row Editor.
- Click OK to close the SheetView Collection Editor.
Using a Shortcut
Set the Columns shortcut object Width property.
Example
This example code sets the second column’s width to 100 pixels.
C# | Copy Code |
---|---|
// Set second column width to 100.
fpSpread1.Sheets[0].Columns[1].Width = 100;
|
VB | Copy Code |
---|---|
' Set second column width to 100.
FpSpread1.Sheets(0).Columns(1).Width = 100
|
Using Code
Set the Width property for a Column object.
Example
This example code sets the second column’s width to 100 pixels.
C# | Copy Code |
---|---|
FarPoint.Win.Spread.Column Col1; Col1 = fpSpread1.Sheets[0].Columns[1]; Col1.Width = 100; |
VB | Copy Code |
---|---|
Dim Col1 As FarPoint.Win.Spread.Column Col1 = FpSpread1.Sheets(0).Columns(1) Col1.Width = 100 |
Using the Spread Designer
- To set the default column width,
- Select the sheet tab for the sheet for which you want to set the default column width.
- In the property list, in the Appearance category, select Columns to expand the list of properties for the columns.
- In the list of properties for columns, select Default to expand the list of default column settings.
- In the list of default settings, change the Width setting.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.
- To set a specific column width,
- Select the column for which you want to change the width.
- In the properties list for that column, change the Width property.
- From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.