Skip to content
Open
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
6 changes: 3 additions & 3 deletions Document-Processing/Excel/Spreadsheet/UWP/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ Optional NuGet Packages</th><th>
Description</th></tr>
<tr>
<td>
[Syncfusion.SfSpreadsheetHelper.UWP](https://www.nuget.org/packages/Syncfusion.SfSpreadsheetHelper.UWP)</td><td>
{{'[Syncfusion.SfSpreadsheetHelper.UWP](https://www.nuget.org/packages/Syncfusion.SfSpreadsheetHelper.UWP)' | markdownify}}</td><td>
Contains the classes responsible for importing charts and sparklines into SfSpreadsheet.</td></tr>
<tr>
<td>
[Syncfusion.ExcelChartToImageConverter.UWP](https://www.nuget.org/packages/Syncfusion.ExcelChartToImageConverter.UWP)</td><td>
{{'[Syncfusion.ExcelChartToImageConverter.UWP](https://www.nuget.org/packages/Syncfusion.ExcelChartToImageConverter.UWP)' | markdownify}}</td><td>
Contains the classes responsible for converting charts to images.</td></tr>
<tr>
<td>
[Syncfusion.SfChart.UWP](https://www.nuget.org/packages/Syncfusion.SfChart.UWP)</td><td>
{{'[Syncfusion.SfChart.UWP](https://www.nuget.org/packages/Syncfusion.SfChart.UWP)' | markdownify}}</td><td>
Contains the classes responsible for importing chart types such as line charts, pie charts, and sparklines.</td></tr>
</table>

Expand Down
38 changes: 19 additions & 19 deletions Document-Processing/Excel/Spreadsheet/WPF/Cell-Customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ documentation: ug

# Cell Customization in WPF Spreadsheet (SfSpreadsheet)

SfSpreadsheet provides support to customize the cell with Data template. It allows to load any WPF control or custom control into the cell.
SfSpreadsheet supports cell customization through a data template, allowing any built-in WPF control or custom control to be hosted in a cell.

In order to customize the cell, please follow the below steps
To customize a cell, follow these steps:

* Create a DataTemplate
* Override the SpreadsheetColumn class
* Create the Custom Cell Renderer
* Associating the Custom Cell Renderer to SpreadsheetGrid
1. Create a DataTemplate.
2. Derive from the SpreadsheetColumn class.
3. Create a Custom Cell Renderer.
4. Associate the Custom Cell Renderer with SpreadsheetGrid.

**Create a DataTemplate**

Create a custom DataTemplate (For ex: Button Template) in the Main window.xaml file,
Create a custom DataTemplate (for example, a Button template) in MainWindow.xaml. Define the template as a resource on the window (or in App.xaml) so it can be referenced by key from code.

{% tabs %}
{% highlight xaml %}
Expand All @@ -31,11 +31,11 @@ Create a custom DataTemplate (For ex: Button Template) in the Main window.xaml f
{% endhighlight %}
{% endtabs %}

**Override the SpreadsheetColumn class**
**Derive from the SpreadsheetColumn Class**

Create an extension class SpreadsheetColumnExt by overriding the [SpreadsheetColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetColumn.html) Class which holds all the operations related with cells.
Create an extension class `SpreadsheetColumnExt` that inherits from the [SpreadsheetColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetColumn.html) class, which holds all the operations related to cells.

Now override the function `OnUpdateColumn` which updates the column properties (cell types, renderer, cell element, etc.) and get the data template which is used for displaying in the particular cell.
Override the `OnUpdateColumn` method, which updates the column properties (cell types, renderer, cell element, and so on), and retrieve the data template used to display content in the cell.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -78,11 +78,11 @@ base.OnUpdateColumn(out oldElement);
{% endhighlight %}
{% endtabs %}

**Create the Custom Cell Renderer**
**Create a Custom Cell Renderer**

Create a SpreadsheetTemplateCellRenderer class by overriding the [SpreadsheetVirtualizingCellRendererBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.CellRenderer.SpreadsheetVirtualizingCellRendererBase-2.html) class to display the defined custom renderer element.
Create a `SpreadsheetTemplateCellRenderer` class that inherits from the [SpreadsheetVirtualizingCellRendererBase](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.CellRenderer.SpreadsheetVirtualizingCellRendererBase-2.html) class to display the custom renderer element.

For initializing the display element, set the content template in `OnInitializeDisplayElement` method and for editing, set the content template in `OnInitializeEditElement` method otherwise it will load the default display and edit element in the cells
To initialize the display element, set the content template in the `OnInitializeDisplayElement` method; to initialize editing, set the content template in the `OnInitializeEditElement` method. Otherwise, the cells will load the default display and edit elements.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -135,13 +135,13 @@ protected override void OnInitializeEditElement(RowColumnIndex rowColumnIndex, C
{% endhighlight %}
{% endtabs %}

N> If you want to load the default edit element, then no need to override the `OnInitializeEditElement` method.
N> If you want to load the default edit element, you do not need to override the `OnInitializeEditElement` method.

**Associating the Custom Cell Renderer to SpreadsheetGrid**
**Associate the Custom Cell Renderer with SpreadsheetGrid**

To associate the custom cell renderer in [SpreadsheetGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetGrid.html), invoke the [WorkbookLoaded](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_WorkbookLoaded) Event of SfSpreadsheet and initialize the SpreadsheetTemplateCellRenderer and add it to the renderer collection.
To associate the custom cell renderer with [SpreadsheetGrid](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetGrid.html), invoke the [WorkbookLoaded](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_WorkbookLoaded) event of `SfSpreadsheet` (in XAML or in code-behind after the control is initialized). In the handler, initialize the `SpreadsheetTemplateCellRenderer` and add it to the renderer collection.

Invoke the [QueryRange](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetGrid.html#Syncfusion_UI_Xaml_Spreadsheet_SpreadsheetGrid_QueryRange) Event of `SpreadsheetGrid` and set the CellType of particular range to be “DataTemplate to load the user defined template.
Next, handle the [QueryRange](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetGrid.html#Syncfusion_UI_Xaml_Spreadsheet_SpreadsheetGrid_QueryRange) event of `SpreadsheetGrid` and set the `CellType` of the particular range to "DataTemplate" to load the user-defined template.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -175,7 +175,7 @@ void grid_QueryRange(object sender, SpreadsheetQueryRangeEventArgs e)
{% endhighlight %}
{% endtabs %}

For more reference, please find the [customization](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Cell_Customization-850724053) sample.
For more details, see the [customization](https://www.syncfusion.com/downloads/support/directtrac/general/ze/Cell_Customization-850724053) sample.


N> You can refer to our [WPF Spreadsheet Editor](https://www.syncfusion.com/wpf-controls/spreadsheet) feature tour page for its groundbreaking feature representations. You can also explore our [WPF Spreadsheet example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the spreadsheet.
N> See the [WPF Spreadsheet](https://www.syncfusion.com/wpf-controls/spreadsheet) feature tour page for an overview of its capabilities. You can also explore the [WPF Spreadsheet example](https://github.com/syncfusion/wpf-demos) on GitHub to see how to render and configure the spreadsheet.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ platform: document-processing
control: SfSpreadsheet
documentation: ug
---
# Spreadsheet Comparison in WPF Spreadsheet
# Spreadsheet Comparison in WPF

## Choose between SfSpreadsheet and Spreadsheet (Classic) control
**SfSpreadsheet** is the recommended choice for new development and for migrating from the legacy Spreadsheet (Classic) control. It delivers improved scrolling performance, broader formula support, workbook-level undo/redo, and richer formatting and validation features.

WPF suite contains **SfSpreadsheet** and **Spreadsheet (Classic)** control for viewing and editing the excel files. SfSpreadsheet is an alternate for Spreadsheet (Classic) control which is marked as classic control. Hence it is recommended to use SfSpreadsheet which provides better performance and rich set features over Spreadsheet (Classic) control.
## Feature comparison

Below are the features that SfSpreadsheet have over Spreadsheet (Classic) control,
WPF suite contains **SfSpreadsheet** and **Spreadsheet (Classic)** controls for viewing and editing Excel files. SfSpreadsheet is the recommended replacement for the legacy Spreadsheet (Classic) control. Hence, it is recommended to use SfSpreadsheet, which provides better performance and a rich set of features over the Spreadsheet (Classic) control.

Below are the features that SfSpreadsheet has over the Spreadsheet (Classic) control:

<table>
<tr>
Expand All @@ -22,40 +24,40 @@ SfSpreadsheet</th></tr>
<tr>
<td>
Scrolling performance</td><td>
Supports fast and fluid scrolling even if the excel has a huge set of data .Thus its performance is high compared to Spreadsheet (Classic) control.</td></tr>
Supports fast and fluid scrolling even if the Excel file has a huge set of data. Thus, its performance is higher than that of the Spreadsheet (Classic) control.</td></tr>
<tr>
<td>
Copy Paste</td><td>
Supports various paste options similar to excel options like Paste, Formulas, Values, Formula and Source Formatting, Values and Source Formatting and Formatting alone. It also provides a good performance compared to Spreadsheet (Classic) control.</td></tr>
Supports various paste options similar to Excel options, such as Paste, Formulas, Values, Formula and Source Formatting, Values and Source Formatting, and Formatting alone. It also provides better performance compared to the Spreadsheet (Classic) control.</td></tr>
<tr>
<td>
Undo/Redo</td><td>
Supports undo/redo functionalities similar to those achieved with Microsoft Office-type applications. This operation records the changes in the whole workbook while Spreadsheet (Classic) Control records the changes in sheet level only.</td></tr>
Supports undo/redo functionalities similar to those achieved with Microsoft Office-type applications. This operation records the changes in the whole workbook, while the Spreadsheet (Classic) control records the changes at the sheet level only.</td></tr>
<tr>
<td>
Formula calculation</td><td>
Provides support for 400+ most widely used formulas and uses Multi-threading concept So, the calculation speed is also high compared to Spreadsheet (Classic) control.</td></tr>
Provides support for 400+ of the most widely used formulas and uses a multi-threading concept, so the calculation speed is also high compared to the Spreadsheet (Classic) control.</td></tr>
<tr>
<td>
Floating Cells</td><td>
Provides support to float cell both in display and edit mode.</td></tr>
Provides support to float a cell in both display and edit modes.</td></tr>
<tr>
<td>
Hyperlinks</td><td>
Provides support for Hyperlink feature which you can create hyperlink for existing files or web page and email addresses too.</td></tr>
Provides support for the Hyperlink feature, letting you create hyperlinks to existing files, web pages, or email addresses.</td></tr>
<tr>
<td>
Conditional Formatting</td><td>
Provides support to define and import the conditional formatting rules such as Data Bars, Icon Sets and Color Scales options which are used to visualize the data.</td></tr>
Provides support to define and import conditional formatting rules, such as Data Bars, Icon Sets, and Color Scales, which are used to visualize the data.</td></tr>
<tr>
<td>
Data validation</td><td>
Provides support for validation for cross sheet references and list validation with formula/cell references compared to Spreadsheet (Classic) control.</td></tr>
Provides support for cross-sheet reference validation and list validation with formula/cell references compared to the Spreadsheet (Classic) control.</td></tr>
</table>

### Properties table
### API mapping

Below are the properties difference between SfSpreadsheet and Spreadsheet (Classic) control,
Below are the property differences between SfSpreadsheet and the Spreadsheet (Classic) control:

<table>
<tr>
Expand All @@ -72,43 +74,49 @@ Gets the active SpreadsheetGrid</td></tr>
<td>
{{'[IsCustomTabItemContextMenuEnabled](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_IsCustomTabItemContextMenuEnabled)'| markdownify }}</td><td>
TabStyleManager -> IsCustomTabItemContextMenuEnabled</td><td>
Gets or sets whether Custom ContextMenu is to be Enabled</td></tr>
Gets or sets whether the custom ContextMenu is enabled</td></tr>
<tr>
<td>
{{ '[ShowTabItemContextMenu](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Tools.Controls.TabControlExt.html#Syncfusion_Windows_Tools_Controls_TabControlExt_ShowTabItemContextMenu)' | markdownify }}</td><td>
TabStyleManager -> ShowTabItemContextMenu</td><td>
Gets or sets whether TabItemContextMenu is to be displayed</td></tr>
Gets or sets whether the TabItemContextMenu is displayed</td></tr>
<tr>
<td>
{{ '[TabItemContextMenu](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_TabItemContextMenu)' | markdownify }}</td><td>
TabStyleManager ->TabItemContextMenu</td><td>
Gets or sets the ContextMenu Items for TabItem</td></tr>
Gets or sets the ContextMenu items for the TabItem</td></tr>
<tr>
<td>
{{ '[ActiveSheet](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_ActiveSheet)' | markdownify }}</td><td>
ExcelProperties->Workbook->ActiveSheet</td><td>
Gets the Current ActiveSheet</td></tr>
Gets the current ActiveSheet</td></tr>
<tr>
<td>
{{ '[Workbook](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_Workbook)' | markdownify }}</td><td>
ExcelProperties->Workbook</td><td>
</td></tr>
Gets the underlying Workbook instance</td></tr>
<tr>
<td>
{{ '[CurrentCellStyle](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_CurrentCellStyle)' | markdownify }}</td><td>
GridProperties->CurrentCellStyle</td><td>
Gets the Style of the Current Cell</td></tr>
Gets the style of the current cell</td></tr>
<tr>
<td>
{{ '[HistoryManager](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SfSpreadsheet.html#Syncfusion_UI_Xaml_Spreadsheet_SfSpreadsheet_HistoryManager)' | markdownify }}</td><td>
GridProperties.ActiveSpreadsheetGrid.Model.CommandStack</td><td>
Gets the command stack of the SfSpreadsheet.By default it has been enabled</td></tr>
Gets the command stack of the SfSpreadsheet. Undo/redo is enabled by default.</td></tr>
<tr>
<td>
{{ '[SheetName](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Spreadsheet.SpreadsheetGrid.html#Syncfusion_UI_Xaml_Spreadsheet_SpreadsheetGrid_SheetName)' | markdownify }}</td><td>
GridProperties->CurrentSheetName</td><td>
Gets the tab sheet name</td></tr>
Gets the name of the active sheet tab</td></tr>
</table>


N> You can refer to our [WPF Spreadsheet Editor](https://www.syncfusion.com/wpf-controls/spreadsheet) feature tour page for its groundbreaking feature representations. You can also explore our [WPF Spreadsheet example](https://github.com/syncfusion/wpf-demos) to know how to render and configure the spreadsheet.
N> See the [WPF Spreadsheet](https://www.syncfusion.com/wpf-controls/spreadsheet) feature tour page for a visual overview, and explore the [WPF Spreadsheet samples](https://github.com/syncfusion/wpf-demos) for runnable examples of rendering and configuring the control.

## See also

- [Getting started with SfSpreadsheet](https://help.syncfusion.com/wpf/spreadsheet/getting-started)
- [WPF Spreadsheet feature tour](https://www.syncfusion.com/wpf-controls/spreadsheet)
- [WPF Spreadsheet samples on GitHub](https://github.com/syncfusion/wpf-demos)
Loading