Spread WinRT Documentation
GrapeCity.Xaml.SpreadSheet.UI.UndoRedo Namespace / ColumnAutoFitUndoAction Class / ColumnAutoFitUndoAction Constructor
The sheet.
The resized columns.
Whether the resized column is in the row header area.
Example


In This Topic
    ColumnAutoFitUndoAction Constructor
    In This Topic
    Creates a new undo action for column automatic fit.
    Syntax
    'Declaration
     
    Public Function New( _
       ByVal sheet As Worksheet, _
       ByVal columns() As ColumnAutoFitExtent, _
       ByVal rowHeader As Boolean _
    )
    'Usage
     
    Dim sheet As Worksheet
    Dim columns() As ColumnAutoFitExtent
    Dim rowHeader As Boolean
     
    Dim instance As New ColumnAutoFitUndoAction(sheet, columns, rowHeader)
    public ColumnAutoFitUndoAction( 
       Worksheet sheet,
       ColumnAutoFitExtent[] columns,
       bool rowHeader
    )

    Parameters

    sheet
    The sheet.
    columns
    The resized columns.
    rowHeader
    Whether the resized column is in the row header area.
    Example
    This example uses auto fit.
    //Add data
    for (var col = 1; col < 6; col++)
    {
        for (var row = 2; row < 11; row++)
        {
            GcSpreadSheet1.Sheets[0].SetValue(row, col, row + col);
        }
    }
    
    GcSpreadSheet1.CanUserUndo = true;     
    GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.ColumnAutoFitExtent[] columns;
    columns =  new GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.ColumnAutoFitExtent[] {new GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.ColumnAutoFitExtent(3)};
    var action = new GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.ColumnAutoFitUndoAction(GcSpreadSheet1.Sheets[0], columns, false);
    GcSpreadSheet1.DoCommand(action);
    'Add data
    For col As Integer = 1 To 6
        For row As Integer = 2 To 11
            GcSpreadSheet1.Sheets(0).SetValue(row, col, row + col)
        Next
    Next
    
    GcSpreadSheet1.CanUserUndo = True
    Dim columns() = {New GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.ColumnAutoFitExtent(3)}
    Dim action As New GrapeCity.Xaml.SpreadSheet.UI.UndoRedo.ColumnAutoFitUndoAction(GcSpreadSheet1.Sheets(0), columns, False)
    GcSpreadSheet1.DoCommand(action)
    See Also