Spread WPF Documentation
GrapeCity.Windows.SpreadSheet.Data Namespace / Cell Class / Text Property
Example


In This Topic
    Text Property (Cell)
    In This Topic
    Gets or sets the text in a cell.
    Syntax
    'Declaration
     
    <DefaultValueAttribute("")>
    Public Property Text As String
    'Usage
     
    Dim instance As Cell
    Dim value As String
     
    instance.Text = value
     
    value = instance.Text
    [DefaultValue("")]
    public string Text {get; set;}

    Property Value

    The formatted text in the cell. The default value is an empty string.
    Example
    This example uses the Text property.
    gcSpreadSheet1.Sheets[0].Cells[0, 0].Underline = true;
    gcSpreadSheet1.Sheets[0].Cells[0, 0].Strikethrough = true;
    gcSpreadSheet1.Sheets[0].Cells[0, 0].Text = "Testing";
    gcSpreadSheet1.Sheets[0].Columns[2].Underline = true;
    gcSpreadSheet1.Sheets[0].Columns[2].Strikethrough = false;
    gcSpreadSheet1.Sheets[0].Rows[3].Underline = false;
    gcSpreadSheet1.Sheets[0].Rows[3].Strikethrough = true;
    listBox1.Items.Add(gcSpreadSheet1.Sheets[0].Cells[0, 0].ActualUnderline.ToString());
    listBox1.Items.Add(gcSpreadSheet1.Sheets[0].Cells[0, 0].ActualStrikethrough.ToString());
    
    private void button1_Click(object sender, RoutedEventArgs e)
            {
    gcSpreadSheet1.Sheets[0].Cells[0, 0].ResetUnderline();
    gcSpreadSheet1.Sheets[0].Cells[0, 0].ResetStrikethrough();
    gcSpreadSheet1.Sheets[0].Columns[2].ResetStrikethrough();
    gcSpreadSheet1.Sheets[0].Columns[2].ResetUnderline();
    gcSpreadSheet1.Sheets[0].Rows[3].ResetStrikethrough();
    gcSpreadSheet1.Sheets[0].Rows[3].ResetUnderline();
            }
    GcSpreadSheet1.Sheets(0).Cells(0, 0).Underline = True
    GcSpreadSheet1.Sheets(0).Cells(0, 0).Strikethrough = True
    GcSpreadSheet1.Sheets(0).Cells(0, 0).Text = "Testing"
    GcSpreadSheet1.Sheets(0).Columns(2).Underline = True
    GcSpreadSheet1.Sheets(0).Columns(2).Strikethrough = False
    GcSpreadSheet1.Sheets(0).Rows(3).Underline = False
    GcSpreadSheet1.Sheets(0).Rows(3).Strikethrough = True
    ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).Cells(0, 0).ActualUnderline.ToString())
    ListBox1.Items.Add(gcSpreadSheet1.Sheets(0).Cells(0, 0).ActualStrikethrough.ToString())
    
    Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
            GcSpreadSheet1.Sheets(0).Cells(0, 0).ResetUnderline()
            GcSpreadSheet1.Sheets(0).Cells(0, 0).ResetStrikethrough()
            GcSpreadSheet1.Sheets(0).Columns(2).ResetStrikethrough()
            GcSpreadSheet1.Sheets(0).Columns(2).ResetUnderline()
            GcSpreadSheet1.Sheets(0).Rows(3).ResetStrikethrough()
            GcSpreadSheet1.Sheets(0).Rows(3).ResetUnderline()
    End Sub
    See Also