Spread Windows Forms 8.0 Product Documentation
ClearRange(Int32,Int32,Int32,Int32,Boolean,ClipboardCopyOptions) Method
Example 


Row index of first cell in range
Column index of first cell in range
Number of rows in range
Number of columns in range
Whether to remove only data
ClipboardCopyOptions
Removes all of the data, formatting, formulas, and notes from a range of cells on this sheet.
Syntax
'Declaration
 
Public Overloads Sub ClearRange( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal rowCount As Integer, _
   ByVal columnCount As Integer, _
   ByVal dataOnly As Boolean, _
   ByVal copyOptions As ClipboardCopyOptions _
) 
'Usage
 
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim rowCount As Integer
Dim columnCount As Integer
Dim dataOnly As Boolean
Dim copyOptions As ClipboardCopyOptions
 
instance.ClearRange(row, column, rowCount, columnCount, dataOnly, copyOptions)
public void ClearRange( 
   int row,
   int column,
   int rowCount,
   int columnCount,
   bool dataOnly,
   ClipboardCopyOptions copyOptions
)

Parameters

row
Row index of first cell in range
column
Column index of first cell in range
rowCount
Number of rows in range
columnCount
Number of columns in range
dataOnly
Whether to remove only data
copyOptions
ClipboardCopyOptions
Example
This example clears the range.
private void Form1_Load(object sender, EventArgs e)
        {
       fpSpread1.Sheets[0].Cells[0, 0].Text = "test";
       fpSpread1.Sheets[0].Cells[0, 1].Text = "B";
       fpSpread1.Sheets[0].Cells[0, 2].Text = "C";
       fpSpread1.Sheets[0].Columns[1].Visible = false;          
        }

private void button1_Click(object sender, EventArgs e)
        {
    fpSpread1.Sheets[0].ClearRange(0, 0, 5, 5, true, FarPoint.Win.Spread.ClipboardCopyOptions.Values);
    //fpSpread1.Sheets[0].ClearRange(0, 0, 5, 5, true);
         }
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        FpSpread1.Sheets(0).Cells(0, 0).Text = "test"
        FpSpread1.Sheets(0).Cells(0, 1).Text = "B"
        FpSpread1.Sheets(0).Cells(0, 2).Text = "C"
        FpSpread1.Sheets(0).Columns(1).Visible = False
    End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        FpSpread1.Sheets(0).ClearRange(0, 0, 5, 5, True, FarPoint.Win.Spread.ClipboardCopyOptions.Values)
        'FpSpread1.Sheets(0).ClearRange(0, 0, 5, 5, True)
    End Sub
Requirements

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

See Also

Reference

SheetView Class
SheetView Members
Overload List

 

 


Copyright © GrapeCity, inc. All rights reserved.