Class SpreadsheetCustomRibbonTab
Represents a custom ribbon tab that can be added to the SfSpreadsheet's ribbon interface.
Inherited Members
Namespace: Syncfusion.Blazor.Spreadsheet
Assembly: Syncfusion.Blazor.Spreadsheet.dll
Syntax
public class SpreadsheetCustomRibbonTab
Remarks
Custom tabs allow developers to extend the ribbon with application-specific functionality beyond the built-in spreadsheet commands. Each custom tab is rendered using a RenderFragment template that defines the tab's content and layout.
Usage:
Examples
Example: Creating a custom ribbon tab
@using Syncfusion.Blazor.Spreadsheet
@using Syncfusion.Blazor.Ribbon
@using Microsoft.AspNetCore.Components
<SfSpreadsheet @ref="SpreadsheetInstance"
CustomRibbonTabs="@GetCustomTabs()">
</SfSpreadsheet>
@code {
public SfSpreadsheet SpreadsheetInstance { get; set; }
List<SpreadsheetCustomRibbonTab> GetCustomTabs()
{
return new List<SpreadsheetCustomRibbonTab>
{
new SpreadsheetCustomRibbonTab
{
Index = 2,
Template = CustomTabTemplate
}
};
}
}
Constructors
SpreadsheetCustomRibbonTab()
Declaration
public SpreadsheetCustomRibbonTab()
Properties
Index
Gets or sets the insertion index for the custom tab within the ribbon's tab collection.
Declaration
public int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| int | An int specifying the zero-based position where the tab will be inserted. The default value is |
Remarks
This property controls the display order of the custom tab relative to existing ribbon tabs.
- Lower indices appear earlier in the ribbon.
- When set to
-1or out of range, the tab is appended to the end of the existing tabs. - Positive indices are relative to the current tab collection at rendering time.
Template
Gets or sets the RenderFragment that defines the custom tab's content and layout.
Declaration
public RenderFragment Template { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | A RenderFragment representing the Blazor markup to render for this tab. The default value is null. |
Remarks
The developer defines the tab header text, icon, and content within this template using standard Blazor ribbon component syntax. The template receives no parameters and should contain the complete tab UI definition.
If null, the tab will not be rendered.