Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Document-Processing/Excel/Spreadsheet/Blazor/protection.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: post
title: Protect Sheet in Blazor Spreadsheet Component | Syncfusion
description: Checkout and learn here all about protect sheet in Syncfusion Blazor Spreadsheet component and more.
title: Protection in Blazor Spreadsheet Component | Syncfusion
description: Learn how to protect and unprotect worksheets and workbooks in the Syncfusion Blazor Spreadsheet component, both through the UI and more.
platform: document-processing
control: Spreadsheet
documentation: ug
Expand All @@ -11,17 +11,18 @@ documentation: ug

Sheet protection is used to prevent unauthorized modification of data within the sheet.

## Protect Sheet
## Sheet Protection

The **Protect Sheet** support helps prevent accidental changes such as editing, moving, or deleting data. Protection can be applied with or without a password, depending on the level of security required.

### Protecting sheets via the UI
### Protecting a sheet via the UI

In the active sheet, the sheet protection can be done by any of the following ways:
The active sheet can be protected using any of the following ways:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The active sheet can be protected using any of the following ways:

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the changes

* Select **Protect Sheet** from the **Review** tab in the Ribbon toolbar and choose the desired options.
* Navigate to the **Review** tab in the Ribbon and select **Protect Sheet**.
* Right-click the sheet's tab in the bottom bar and select **Protect Sheet** from the context menu.

* Right-click the sheet tab context menu option, select **Protect Sheet** from the context menu, and choose the desired options.
In the **Protect Sheet** dialog, you can set a password and specify which actions users are allowed to perform.

![Protected Sheet Dialog](./images/protect-sheet.gif)

Expand Down Expand Up @@ -107,4 +108,4 @@ To unprotect the workbook:

* Enter the correct password in the dialog box, then click **OK**.

![Unprotected Workbook Dialog](./images/unprotect-workbook.png)
![Unprotected Workbook Dialog](./images/unprotect-workbook.png)
28 changes: 14 additions & 14 deletions Document-Processing/Excel/Spreadsheet/Blazor/selection.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
---
layout: post
title: Selection in Blazor Spreadsheet Component | Syncfusion
description: Checkout and learn here all about comprehensive selection functionality in Syncfusion Blazor Spreadsheet component and much more.
description: Learn about the comprehensive selection functionality in the Syncfusion Blazor Spreadsheet component, including programmatic and UI-driven methods.
platform: document-processing
control: Spreadsheet
documentation: ug
---

# Selection in Blazor Spreadsheet component
# Selection in Blazor Spreadsheet Component

The selection feature in the Spreadsheet component enables interactive highlighting and manipulation of cells, rows, or columns for data analysis and editing operations. The functionality offers intuitive mouse and keyboard interactions for efficient data management.

The Blazor Spreadsheet provides multiple selection options to manage and analyze data effectively:

* **Cell Selection** - Select individual cells or ranges of cells for data manipulation
* **Row Selection** - Select entire rows for row-based operations
* **Column Selection** - Select entire columns for column-based operations
* **Cell Selection**: Select individual cells or range of cells for data manipulation
* **Row Selection**: Select entire rows for row-based operations
* **Column Selection**: Select entire columns for column-based operations

**Accessing selection via the UI**

In the active sheet, selection can be performed using any of the following ways:

* **Using Mouse Interaction**:
* Click to select individual cells
* Click and drag to select ranges
* Click row or column headers for full row or column selection
* Click a cell to select it.
* Click and drag to select a range of cells.
* Click a row or column header to select the entire row or column.

* **Using Keyboard Navigation**:
* Use **Arrow** keys to navigate and select cells
* Use **Arrow** keys to navigate between cells
* Use **Shift + Arrow** keys for range selection
* Use **Ctrl + Click** for non-adjacent selections

* **Using Name Box**: Enter cell references or range names and press **Enter** key to select the specified range.
* **Using Name Box**: Enter a cell reference (e.g., `C5`) or a range (`A1:E5`) and press **Enter** key to select the specified range.

## Cell selection
## Cell Selection

The Blazor Spreadsheet component allows selecting individual cells or ranges of cells for various data operations. Cell selection forms the foundation of most Spreadsheet interactions and serves as the basis for data entry and formatting.

Expand Down Expand Up @@ -74,9 +74,9 @@ The column selection operation can be performed using the following methods:
* **Non-adjacent columns**: Hold **Ctrl** while clicking individual column headers
* **Range with keyboard**: Use **Shift + Arrow** keys after selecting the initial column

## Implementing selection programmatically
## Implementing Selection Programmatically

The Spreadsheet component supports comprehensive programmatic selection using the [SelectRangeAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_SelectRangeAsync_System_String_) method. This method accepts various range formats and selection patterns.
The Spreadsheet component supports programmatic selection for cells, rows, and columns using the [SelectRangeAsync()](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_SelectRangeAsync_System_String_) method. This method accepts various range formats and selection patterns.

{% tabs %}
{% highlight razor tabtitle="Index.razor" %}
Expand Down Expand Up @@ -113,4 +113,4 @@ The Spreadsheet component supports comprehensive programmatic selection using th

The following image illustrates the comprehensive selection capabilities available in the Blazor Spreadsheet component, including cell, row, and column selection using both mouse and keyboard interactions.

![Comprehensive selection operation](./images/selection-types.gif)
![An animated GIF demonstrating cell, row, and column selection in the Syncfusion Blazor Spreadsheet.](./images/selection-types.gif)
43 changes: 22 additions & 21 deletions Document-Processing/Excel/Spreadsheet/Blazor/sorting.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
layout: post
title: Sorting in Blazor Spreadsheet Component | Syncfusion
description: Checkout and learn here about sorting functionality in Syncfusion Blazor Spreadsheet component and much more.
description: Learn how to perform data sorting in the Blazor Spreadsheet component, including multi-column sorting, custom sort orders, and more.
platform: document-processing
component: Spreadsheet
control: Spreadsheet
documentation: ug
---

# Sorting in Blazor Spreadsheet component
# Sorting in Blazor Spreadsheet Component

The Blazor Spreadsheet component provides built-in sorting functionality that enables users to organize worksheet data in either ascending or descending order. This support is especially helpful for improving readability and simplifying data analysis by arranging content according to selected columns. The sorting behavior is controlled by the [`AllowSorting`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_AllowSorting) property, which is set to `true` by default. When `AllowSorting` is set to `false`, all sorting options are removed from the interface, including the Ribbon and Context Menu, and related API methods become inactive. Additionally, sorting is disabled if the worksheet is protected. For more information on worksheet protection, refer [here](./protection#protect-sheet).
The Blazor Spreadsheet component provides built-in sorting functionality that enables users to organize worksheet data in either ascending or descending order. This feature helps improve readability and simplifies data analysis by arranging content according to selected columns. The sorting behavior is controlled by the [`AllowSorting`](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spreadsheet.SfSpreadsheet.html#Syncfusion_Blazor_Spreadsheet_SfSpreadsheet_AllowSorting) property, which is set to `true` by default. When `AllowSorting` is set to `false`, all sorting options are removed from the interface, including the Ribbon and Context Menu, and related API methods become inactive. Additionally, sorting is disabled if the worksheet is protected. For more information on worksheet protection, refer to the [worksheet protection documentation](./protection#protect-sheet).

## Sort operations
## Sort Operations

The component supports two types of sort orders that help organize data for easier analysis and presentation:
The component supports two types of sort orders that help organize data for analysis and presentation:

* **Ascending** - Arranges data from lowest to highest (A to Z, 0 to 9).
* **Descending** - Arranges data from highest to lowest (Z to A, 9 to 0).
* **Ascending**: Arranges data from lowest to highest (e.g., A to Z, 0 to 9).
* **Descending**: Arranges data from highest to lowest (e.g., Z to A, 9 to 0).

### Sort via UI

Expand All @@ -27,45 +27,46 @@ Sorting can be performed through the user interface (UI) using any of the follow
- Select a cell or range of cells to sort.
- Click the **Home** tab in the **Ribbon**.
- Click the **Sort & Filter** icon.
- Choose either **Ascending** or **Descending** from the dropdown menu.
- Choose either **Sort Ascending** or **Sort Descending** from the dropdown menu.

![Sort option via Ribbon](./images/ribbon-sort.png)

**Using the Context Menu**

- Select a cell or range of cells to sort.
- Right-click on the selected range to open the context menu.
- Select a cell or a range of cells to sort.
- Right-click the selected range to open the context menu.
- Hover over the **Sort** option.
- Select either **Ascending** or **Descending** from the submenu.

![Sort option via Context Menu](./images/contextmenu-sort.png)

**Using the Filter Dialog**

If filtering is enabled, sorting can also be performed using the filter dialog. This adds another layer of flexibility by allowing users to sort data directly through the filtered view. For more details on how filtering works in the Blazor Spreadsheet component, refer [here](./filtering).
If filtering is enabled, sorting can also be performed using the filter dialog. This adds another layer of flexibility by allowing users to sort data directly through the filtered view. For more details on how filtering works in the Blazor Spreadsheet component, refer to the [filtering documentation](./filtering).


- Apply **Filter** to the desired column.
- Click the filter icon in the column header.
- Apply a **Filter** to the desired column.
- Click the filter icon in a column header.
- In the filter dialog, choose either **Sort Ascending** or **Sort Descending**.
- The sort will be applied to the entire used range based on the selected column.
- The sort operation is applied to the entire used range based on the selected column.

![Sort option via Filter Dialog](./images/filter-dialog-sort.gif)

### Sort by active cell

When a sort operation is performed without an explicitly selected range, the component automatically identifies the **used range** of the worksheet. The used range includes all contiguous cells that contain data. Sorting is applied to this range using the column of the **active cell** as the sort key.
When a sort operation is performed without an explicitly selected range, the component automatically identifies the **used range** of the worksheet. The used range includes all contiguous cells that contain data. Sorting is applied to this entire range using the column of the **active cell** as the sort key.

A **sort key** is the column whose values determine the order of the rows during sorting. It compares the values in this column and rearranges the rows accordingly.
The **sort key** is the column whose values determine the order of the rows during sorting. It compares the values in this column and rearranges the rows accordingly.

This behavior ensures that the entire dataset is sorted cohesively, preserving row integrity and preventing data misalignment.

**Example**

If the **active cell** is located in **Column C** and no range is selected, it's sorts all rows within the used range based on the values in **Column C**.

### Sort by selected range
### Sorting a Selected Range

When a specific range is selected before initiating a sort operation, the component restricts the sort to the selected range. The column of the active cell within the selected range is used as the sort key. This method allows targeted sorting of a subset of data without affecting the rest of the worksheet.
When a specific cell range is selected, the sort operation is restricted to that range. The column of the active cell within the selected range is used as the sort key. This method allows for targeted sorting of a subset a data without affecting the rest of the worksheet.

**Example**

Expand Down Expand Up @@ -103,8 +104,8 @@ The [SortRangeAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Spr

public async Task SortData()
{
// Sorts the range B2:D5 in ascending order based on values in "Column B".
await SpreadsheetInstance.SortRangeAsync("B2:D5", SortDirection.Ascending);
// Sorts the range B2:D5 in ascending order based on values in "Column B".
await SpreadsheetInstance.SortRangeAsync("B2:D5", SortDirection.Ascending);
}
}

Expand Down