Spread WPF 15
GrapeCity.Windows.SpreadSheet.Data Namespace / Worksheet Class / SetViewportWidth Method
The index of the column viewport.
The width value.
Example


In This Topic
    SetViewportWidth Method
    In This Topic
    Sets the width of the viewport.
    Syntax
    'Declaration
     
    Public Sub SetViewportWidth( _
       ByVal columnViewportIndex As Integer, _
       ByVal value As Integer _
    ) 
    'Usage
     
    Dim instance As Worksheet
    Dim columnViewportIndex As Integer
    Dim value As Integer
     
    instance.SetViewportWidth(columnViewportIndex, value)
    public void SetViewportWidth( 
       int columnViewportIndex,
       int value
    )

    Parameters

    columnViewportIndex
    The index of the column viewport.
    value
    The width value.
    Example
    This example uses the SetViewportWidth method.
        gcSpreadSheet1.AddColumnViewport(0, 100);
        gcSpreadSheet1.AddRowViewport(0, 80);
        gcSpreadSheet1.RowSplitBoxAlignment = GrapeCity.Windows.SpreadSheet.UI.SplitBoxAlignment.Leading;
        gcSpreadSheet1.ColumnSplitBoxAlignment = GrapeCity.Windows.SpreadSheet.UI.SplitBoxAlignment.Trailing;
        gcSpreadSheet1.Sheets[0].SetViewportHeight(0, 100);
        gcSpreadSheet1.Sheets[0].SetViewportWidth(0, 100);
        gcSpreadSheet1.Invalidate();           
          
    private void button1_Click(object sender, RoutedEventArgs e)
    {
        gcSpreadSheet1.RemoveColumnViewport(0);
        gcSpreadSheet1.RemoveRowViewport(0);
        gcSpreadSheet1.Invalidate();
    }
                GcSpreadSheet1.AddColumnViewport(0, 100)
                GcSpreadSheet1.AddRowViewport(0, 80)
                GcSpreadSheet1.RowSplitBoxAlignment = GrapeCity.Windows.SpreadSheet.UI.SplitBoxAlignment.Leading
                GcSpreadSheet1.ColumnSplitBoxAlignment = GrapeCity.Windows.SpreadSheet.UI.SplitBoxAlignment.Trailing
                GcSpreadSheet1.Sheets[0].SetViewportHeight(0, 100)
                GcSpreadSheet1.Sheets[0].SetViewportWidth(0, 100)
                GcSpreadSheet1.Invalidate()    
    
    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
          GcSpreadSheet1.RemoveColumnViewport(0)
          GcSpreadSheet1.RemoveRowViewport(0)
          GcSpreadSheet1.Invalidate()
    End Sub
    See Also