Skip to content
1 change: 1 addition & 0 deletions Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -4818,6 +4818,7 @@
<li><a href="/document-processing/excel/spreadsheet/blazor/editing">Editing</a></li>
<li><a href="/document-processing/excel/spreadsheet/blazor/formulas">Formulas</a></li>
<li><a href="/document-processing/excel/spreadsheet/blazor/contextmenu">Context Menu</a></li>
<li><a href="/document-processing/excel/spreadsheet/blazor/rows-and-columns">Row and Columns</a></li>
<li><a href="/document-processing/excel/spreadsheet/blazor/filtering">Filtering</a></li>
<li><a href="/document-processing/excel/spreadsheet/blazor/sorting">Sorting</a></li>
<li><a href="/document-processing/excel/spreadsheet/blazor/hyperlink">Hyperlink</a></li>
Expand Down
7 changes: 5 additions & 2 deletions Document-Processing/Excel/Spreadsheet/Blazor/cell-range.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ Cell formatting options include:
* **Middle** – Centers content vertically
* **Bottom** – Default alignment

* **Wrap Text** - Displays long content on multiple lines within a single cell, preventing it from overflowing into adjacent cells.
* **Wrap Text** - Displays long content on multiple lines within a single cell, preventing it from overflowing into adjacent cells. To enable text wrapping:
1. Select the target cell or range (e.g., C5).
2. Go to the Home tab.
3. Click Wrap Text in the ribbon to toggle text wrapping for the selected cells.

Cell formatting can be applied to or removed from a cell or range of cells by using the formatting options available in the Ribbon toolbar under the **Home** tab.

Expand Down Expand Up @@ -121,4 +124,4 @@ The clear support can be applied using the following way:

The following image displays the clear options available in the Ribbon toolbar under the **Home** tab of the Blazor Spreadsheet.

![Clear options in the Blazor Spreadsheet](images/clear-feature.png)
![Clear options in the Blazor Spreadsheet](images/clear-feature.png)
170 changes: 170 additions & 0 deletions Document-Processing/Excel/Spreadsheet/Blazor/rows-and-columns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
---
layout: post
title: Rows and columns in Blazor Spreadsheet component | Syncfusion
description: Checkout and learn here all about Rows and columns in the Syncfusion Blazor Spreadsheet component and more.
platform: document-processing
control: Spreadsheet
documentation: ug
---

# Rows and columns in Blazor Spreadsheet component

Spreadsheet is a tabular format consisting of rows and columns. The intersection point of rows and columns are called as cells. The list of operations that you can perform in rows and columns are,

* Insert
* Setting Column and Row Count

## Insert

You can insert rows or columns anywhere in a spreadsheet.

### Row

The rows can be inserted in the following ways:

**Using the context menu**

Insert rows in the desired position by right-clicking on a row header.

**Using `InsertRowAsync` method**

Using [`InsertRowAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_InsertRowAsync_System_Int32_System_Int32_System_Object_Syncfusion_Blazor_Spreadsheet_RowPosition_) method, you can insert the rows once the component is loaded.

The following code example shows the options for inserting rows in the spreadsheet.

{% tabs %}
{% highlight razor tabtitle="Index.razor" %}

@using Syncfusion.Blazor.Spreadsheet
@using Syncfusion.Blazor.Buttons

<SfButton OnClick="InsertRowsHandler" Content="Insert Rows"></SfButton>
<SfSpreadsheet @ref="@SpreadsheetInstance" DataSource="DataSourceBytes">
<SpreadsheetRibbon></SpreadsheetRibbon>
</SfSpreadsheet>

@code {
public byte[] DataSourceBytes { get; set; }
public SfSpreadsheet SpreadsheetInstance;

protected override void OnInitialized()
{
string filePath = "wwwroot/Sample.xlsx";
DataSourceBytes = File.ReadAllBytes(filePath);
}

public async Task InsertRowsHandler()
{
// Insert 2 rows above row index 0 in the active sheet
await SpreadsheetInstance.InsertRowAsync(0, 2);

// Insert 3 rows below row index 2 in the sheet named "Sheet2"
await SpreadsheetInstance.InsertRowAsync(2, 3, "Sheet2", RowPosition.Below);

// Insert 1 row above row index 1 in the active sheet
await SpreadsheetInstance.InsertRowAsync(1, 1, null, RowPosition.Above);

// Insert 4 rows below row index 3 in the sheet at index 3
await SpreadsheetInstance.InsertRowAsync(3, 4, 3, RowPosition.Below);
}
}

{% endhighlight %}
{% endtabs %}

### Column

The columns can be inserted in the following ways:

**Using the context menu**

Insert columns in the desired position by right-clicking on a column header.

**Using `InsertColumnAsync` method**

Using [`InsertColumnAsync`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_InsertColumnAsync_System_Int32_System_Int32_System_Object_Syncfusion_Blazor_Spreadsheet_ColumnPosition_) method, you can insert the columns once the component is loaded.

The following code example shows the options for inserting columns in the spreadsheet.

{% tabs %}
{% highlight razor tabtitle="Index.razor" %}

@using Syncfusion.Blazor.Spreadsheet
@using Syncfusion.Blazor.Buttons

<SfButton OnClick="InsertColumnsHandler" Content="Insert Columns"></SfButton>
<SfSpreadsheet @ref="@SpreadsheetInstance" DataSource="DataSourceBytes">
<SpreadsheetRibbon></SpreadsheetRibbon>
</SfSpreadsheet>

@code {
public byte[] DataSourceBytes { get; set; }
public SfSpreadsheet SpreadsheetInstance;

protected override void OnInitialized()
{
string filePath = "wwwroot/Sample.xlsx";
DataSourceBytes = File.ReadAllBytes(filePath);
}

public async Task InsertColumnsHandler()
{
// Insert 2 columns to the right of column index 2
await SpreadsheetInstance.InsertColumnAsync(2, 2);

// Insert 3 columns to the left of column index 5
await SpreadsheetInstance.InsertColumnAsync(5, 3, null, ColumnPosition.Left);

// Insert 1 column to the right of column B in Sheet2
await SpreadsheetInstance.InsertColumnAsync(1, 1, "Sheet2", ColumnPosition.Right);

// Insert 4 columns to the left of column D in the sheet at index 3
await SpreadsheetInstance.InsertColumnAsync(3, 4, 3, ColumnPosition.Left);
}
}

{% endhighlight %}
{% endtabs %}

## Setting Row and Column Count

The Blazor Spreadsheet component enables you to define the initial number of rows and columns using the [`RowCount`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_RowCount) and [`ColumnCount`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_ColumnCount) properties.

* The default `RowCount` is **1000**.
* The default `ColumnCount` is **200**.

**Rendering Behavior**

- **Without Data Source:**

- When no data is bound to the spreadsheet, the sheet renders empty cells up to RowCount × ColCount.

- **With Data Source (e.g., byte array or imported file):**

- If the data source has fewer rows/columns than RowCount/ColCount, the spreadsheet renders additional empty rows/columns to meet the specified counts.
- If the data source has more rows/columns than RowCount/ColCount, the spreadsheet renders enough rows/columns to display all data from the source (i.e., it extends beyond the specified counts to fit the data). Your data is never truncated by these properties.


You can set these properties as follows:

{% tabs %}
{% highlight razor tabtitle="Index.razor" %}

@using Syncfusion.Blazor.Spreadsheet

<SfSpreadsheet DataSource="DataSourceBytes" RowCount="1200" ColumnCount="300" >
<SpreadsheetRibbon></SpreadsheetRibbon>
</SfSpreadsheet>

@code {
public byte[] DataSourceBytes { get; set; }

protected override void OnInitialized()
{
string filePath = "wwwroot/Sample.xlsx";
DataSourceBytes = File.ReadAllBytes(filePath);
}
}

{% endhighlight %}
{% endtabs %}
126 changes: 126 additions & 0 deletions Document-Processing/PDF/PDF-Library/NET/Working-with-Annotations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5068,6 +5068,132 @@ document.Close(True)

You can download a complete working sample from [GitHub](https://github.com/SyncfusionExamples/PDF-Examples/tree/master/Annotation/Adding-transparency-for-annotations/.NET).

## Setting Annotation Intent in PdfFreeTextAnnotation

The [PdfAnnotationIntent.FreeTextTypeWriter](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Interactive.PdfAnnotationIntent.html#fields) value specifies that a `free text annotation` in a PDF should behave like a `typewriter-style input field`. This intent is especially useful for simulating manual typing on forms or documents, enabling users to add clear, typed comments or responses.

{% tabs %}

{% highlight c# tabtitle="C# [Cross-platform]" %}

using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Interactive;

// Create a new PDF document
using (PdfDocument document = new PdfDocument())
{
// Add a page
PdfPage page = document.Pages.Add();

// Define the bounds for the annotation
RectangleF bounds = new RectangleF(100, 100, 200, 50);

// Create a FreeText annotation
PdfFreeTextAnnotation freeText = new PdfFreeTextAnnotation(bounds);
// Add content.
freeText.Text = "Add Free Text Annotation with Intent";
// Set the annotation intent to TypeWriter
freeText.AnnotationIntent = PdfAnnotationIntent.FreeTextTypeWriter;

// Customize appearance
freeText.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
freeText.TextMarkupColor = Color.Black;
freeText.BorderColor = Color.Gray;
freeText.Color = Color.LightYellow;

// Add the annotation to the page
page.Annotations.Add(freeText);

// Save the document
document.Save("Output.pdf");
}

{% endhighlight %}

{% highlight c# tabtitle="C# [Windows-specific]" %}

using Syncfusion.Drawing;
using Syncfusion.Pdf;
using Syncfusion.Pdf.Graphics;
using Syncfusion.Pdf.Interactive;

// Create a new PDF document
using (PdfDocument document = new PdfDocument())
{
// Add a page
PdfPage page = document.Pages.Add();

// Define the bounds for the annotation
RectangleF bounds = new RectangleF(100, 100, 200, 50);

// Create a FreeText annotation
PdfFreeTextAnnotation freeText = new PdfFreeTextAnnotation(bounds);
// Add content.
freeText.Text = "Add Free Text Annotation with Intent";
// Set the annotation intent to TypeWriter
freeText.AnnotationIntent = PdfAnnotationIntent.FreeTextTypeWriter;

// Customize appearance
freeText.Font = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
freeText.TextMarkupColor = Color.Black;
freeText.BorderColor = Color.Gray;
freeText.Color = Color.LightYellow;

// Add the annotation to the page
page.Annotations.Add(freeText);

// Save the document
document.Save("Output.pdf");
}

{% endhighlight %}

{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}

Imports Syncfusion.Drawing
Imports Syncfusion.Pdf
Imports Syncfusion.Pdf.Graphics
Imports Syncfusion.Pdf.Interactive

' Create a new PDF document
Using document As New PdfDocument()

' Add a page
Dim page As PdfPage = document.Pages.Add()

' Define the bounds for the annotation
Dim bounds As New RectangleF(100, 100, 200, 50)

' Create a FreeText annotation
Dim freeText As New PdfFreeTextAnnotation(bounds)

' Add content
freeText.Text = "Add Free Text Annotation with Intent"

' Set the annotation intent to TypeWriter
freeText.AnnotationIntent = PdfAnnotationIntent.FreeTextTypeWriter

' Customize appearance
freeText.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 12)
freeText.TextMarkupColor = Color.Black
freeText.BorderColor = Color.Gray
freeText.Color = Color.LightYellow

' Add the annotation to the page
page.Annotations.Add(freeText)

' Save the document
document.Save("Output.pdf")
End Using

{% endhighlight %}

{% endtabs %}

You can download a complete working sample from GitHub.

## Adding comments and review status to the PDF annotation

The PDF annotations may have an author-specific state associated with them. The state is not specified in the annotation itself, but it represents a separate text annotation ([Popup Annotation](https://help.syncfusion.com/cr/document-processing/Syncfusion.Pdf.Interactive.PdfPopupAnnotation.html)).
Expand Down