Spread Windows Forms 10.0 Product Documentation
PreferredSizeColumnOptions Enumeration
Example Example 


Specifies the options when getting the preferred width for the column.
Syntax
'Declaration
 
Public Enum PreferredSizeColumnOptions 
   Inherits System.Enum
'Usage
 
Dim instance As PreferredSizeColumnOptions
public enum PreferredSizeColumnOptions : System.Enum 
Members
MemberDescription
ExcludeFootersSpecifies to ignore footers
ExcludeHeadersSpecifies to ignore headers
ExcludeSpansSpecifies to ignore spans
ExcludeWordWrapSpecifies to exclude cells with wrapped contents
IncludeAllSpecifies to include all automatic fit options
OffSpecifies to turn off automatic fit for the column width
Example
This example uses the PreferredSizeColumnOptions enumerations.
fpSpread1.ActiveSheet.ColumnHeader.Cells[0,2].Text = "Column Header Text";
fpSpread1.ActiveSheet.Cells[1, 1].Text = "Text in cell (1, 1)";
FarPoint.Win.Spread.CellType.TextCellType textcell = new FarPoint.Win.Spread.CellType.TextCellType();
textcell.WordWrap = true;
fpSpread1.ActiveSheet.Cells[2, 2].CellType = textcell;
fpSpread1.ActiveSheet.Cells[2, 2].Text = "Spread Windows Forms and the Funnel Chart";
fpSpread1.AutoFitColumnOptions = FarPoint.Win.Spread.PreferredSizeColumnOptions.ExcludeHeaders | FarPoint.Win.Spread.PreferredSizeColumnOptions.ExcludeSpans;
fpSpread1.AutoFitRowOptions = FarPoint.Win.Spread.PreferredSizeRowOptions.ExcludeHeaders;

private void button1_Click(object sender, EventArgs e)
        {
            float size;
            size = fpSpread1.ActiveSheet.GetPreferredRowHeight(2, FarPoint.Win.Spread.PreferredSizeRowOptions.ExcludeHeaders);
            textBox1.Text = size.ToString();
        }
FpSpread1.ActiveSheet.ColumnHeader.Cells(0, 2).Text = "Column Header Text"
FpSpread1.ActiveSheet.Cells(1, 1).Text = "Text in cell (1, 1)"
Dim textcell As New FarPoint.Win.Spread.CellType.TextCellType()
textcell.WordWrap = True
FpSpread1.ActiveSheet.Cells(2, 2).CellType = textcell
FpSpread1.ActiveSheet.Cells(2, 2).Text = "Spread Windows Forms and the Funnel Chart"
FpSpread1.AutoFitColumnOptions = FarPoint.Win.Spread.PreferredSizeColumnOptions.ExcludeHeaders Or FarPoint.Win.Spread.PreferredSizeColumnOptions.ExcludeSpans
FpSpread1.AutoFitRowOptions = FarPoint.Win.Spread.PreferredSizeRowOptions.ExcludeHeaders

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim size As Integer
size = FpSpread1.ActiveSheet.GetPreferredRowHeight(2, FarPoint.Win.Spread.PreferredSizeRowOptions.ExcludeHeaders)
TextBox1.Text = size
End Sub
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         FarPoint.Win.Spread.PreferredSizeColumnOptions

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

FarPoint.Win.Spread Namespace

 

 


Copyright © GrapeCity, inc. All rights reserved.