Class SpreadsheetCustomRibbonGroup
Represents a custom ribbon group that can be added to an existing ribbon tab in the SfSpreadsheet's ribbon interface.
Inherited Members
Namespace: Syncfusion.Blazor.Spreadsheet
Assembly: Syncfusion.Blazor.Spreadsheet.dll
Syntax
public class SpreadsheetCustomRibbonGroup
Remarks
Custom groups allow developers to add containers for related custom commands within existing ribbon tabs such as Home or Insert. Groups provide visual separation and organization of related ribbon items.
Usage:
Examples
Example: Adding a custom ribbon group to the Home tab
@using Syncfusion.Blazor.Spreadsheet
@using Microsoft.AspNetCore.Components
@using Syncfusion.Blazor.Ribbon
<SfSpreadsheet @ref="SpreadsheetInstance"
CustomRibbonGroups="@GetCustomGroups()">
</SfSpreadsheet>
@code {
public SfSpreadsheet SpreadsheetInstance { get; set; }
List<SpreadsheetCustomRibbonGroup> GetCustomGroups()
{
return new List<SpreadsheetCustomRibbonGroup>
{
new SpreadsheetCustomRibbonGroup
{
TabId = "homeTab",
Index = 5,
Template = CustomGroupTemplate
}
};
}
}
Constructors
SpreadsheetCustomRibbonGroup()
Declaration
public SpreadsheetCustomRibbonGroup()
Properties
Index
Gets or sets the insertion index for the custom group within its parent tab.
Declaration
public int Index { get; set; }
Property Value
| Type | Description |
|---|---|
| int | An int specifying the zero-based position where the group will be inserted within the tab. The default value is |
Remarks
This property controls the display order of the custom group relative to existing groups in the parent tab.
- Lower indices appear earlier within the tab.
- When set to
-1or out of range, the group is appended to the end of the tab. - Positive indices are relative to the current group collection at rendering time.
TabId
Gets or sets the unique identifier of the parent tab that will contain this custom group.
Declaration
public string TabId { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A string representing the tab ID (e.g., "homeTab", "insertTab"). The default value is Empty. |
Remarks
This property specifies which ribbon tab will host the custom group.
- For built-in tabs, use standard IDs like "homeTab", "insertTab", "reviewTab", or "viewTab".
- If the specified tab does not exist, the group will not be inserted.
- An empty string is treated as null.
Template
Gets or sets the RenderFragment that defines the custom group'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 group. The default value is null. |
Remarks
The developer defines the group header text, icon, and content within this template using standard Blazor ribbon component syntax. The template receives no parameters and should contain the complete group UI definition including any child items.
If null, the group will not be rendered.