alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SpreadsheetCustomRibbonItem

    Represents a custom ribbon item (button, dropdown, etc.) that can be added to an existing ribbon group in the SfSpreadsheet's ribbon interface.

    Inheritance
    object
    SpreadsheetCustomRibbonItem
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Spreadsheet
    Assembly: Syncfusion.Blazor.Spreadsheet.dll
    Syntax
    public class SpreadsheetCustomRibbonItem
    Remarks

    Custom items enable developers to add application-specific buttons, dropdowns, and other controls to ribbon groups. Each custom item is rendered using a RenderFragment template that defines its content and behavior.

    Usage:

    • Set GroupId to specify the parent group (e.g., "clipboardGroup", "fontStyleGroup").
    • Provide a Template with your custom item markup and event handlers.
    • Set Index to control the item's position within the group.
    Examples

    Example: Adding a custom ribbon item (button) to the Clipboard group

    @using Syncfusion.Blazor.Spreadsheet
    @using Syncfusion.Blazor.Ribbon
    @using Microsoft.AspNetCore.Components
    
    <SfSpreadsheet @ref="SpreadsheetInstance"
                   CustomRibbonItems="@GetCustomItems()">
    </SfSpreadsheet>
    
    @code {
        public SfSpreadsheet SpreadsheetInstance { get; set; }
    
    
        List<SpreadsheetCustomRibbonItem> GetCustomItems()
        {
            return new List<SpreadsheetCustomRibbonItem>
            {
                new SpreadsheetCustomRibbonItem
                {
                    GroupId = "clipboardGroup",
                    Index = 3,
                    Template = CustomItemTemplate
                }
            };
        }
    }

    Constructors

    SpreadsheetCustomRibbonItem()

    Declaration
    public SpreadsheetCustomRibbonItem()

    Properties

    GroupId

    Gets or sets the unique identifier of the parent group that will contain this custom item.

    Declaration
    public string GroupId { get; set; }
    Property Value
    Type Description
    string

    A string representing the group ID (e.g., "clipboardGroup", "fontStyleGroup"). The default value is Empty.

    Remarks

    This property specifies which ribbon group will host the custom item.

    • For built-in groups, use standard IDs corresponding to the ribbon structure.
    • If the specified group does not exist, the item will not be inserted.
    • An empty string is treated as null.

    Index

    Gets or sets the insertion index for the custom item within its parent group.

    Declaration
    public int Index { get; set; }
    Property Value
    Type Description
    int

    An int specifying the zero-based position where the item will be inserted within the group. The default value is -1.

    Remarks

    This property controls the display order of the custom item relative to existing items in the parent group.

    • Lower indices appear earlier within the group.
    • When set to -1 or out of range, the item is appended to the end of the group.
    • Positive indices are relative to the current item collection at rendering time.

    Template

    Gets or sets the RenderFragment that defines the custom item'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 item. The default value is null.

    Remarks

    The developer defines the item's label, icon, and behavior within this template using standard Blazor ribbon component syntax. The template receives no parameters and can include event handlers such as @onclick callbacks.

    If null, the item will not be rendered.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved