Visual Basic (Declaration) | |
---|---|
Public Sub SetText( _ ByVal row As Integer, _ ByVal column As Integer, _ ByVal value As String _ ) |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As SheetView Dim row As Integer Dim column As Integer Dim value As String instance.SetText(row, column, value) |
Parameters
- row
- Row index
- column
- Column index
- value
- Text for the specified cell
Exception | Description |
---|---|
System.ArgumentOutOfRangeException | Specified row index is out of range; must be between 0 and the total number of rows |
System.ArgumentOutOfRangeException | Specified column index is out of range; must be between 0 and the total number of columns |
Besides using this method, you can get or set the value in a cell using various properties of the sheet (SheetView object) or properties of the cell (Cell object). For more information, see Handling Data Using Sheet Methods and Handling Data Using Cell Properties.
Remember that the data may be displayed differently in a cell depending on the cell type. For more information, see Understanding Cell Type Effects on Displaying Data.
This example illustrates the use of this member by returning the text (formatted data) for the specified cell.
C# | Copy Code |
---|---|
fpSpread1.ActiveSheet.SetText(0, 0, "FarPoint"); label1.Text = "The text in the first cell is - " + fpSpread1.ActiveSheet.GetText(0, 0); |
Visual Basic | Copy Code |
---|---|
FpSpread1.ActiveSheet.SetText(0, 0, "FarPoint") Label1.Text = "The text in the first cell is - " & FpSpread1.ActiveSheet.GetText(0, 0) |
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8