SpreadsheetControl.CommandProvider Property

Gets or sets the SpreadsheetControl’s command provider. This is a dependency property.

Namespace: DevExpress.Xpf.Spreadsheet

Assembly: DevExpress.Xpf.Spreadsheet.v21.2.dll


public CommandProvider CommandProvider { get; set; }

Property Value

Type Description

A DevExpress.Xpf.Spreadsheet.CommandProvider object.


A command provider stores commands used by the integrated ribbon. You can use it to assign a command to a ribbon item, as shown in the example below. To get access to the SpreadsheetControl in binding syntax, use the SpreadsheetControl.Spreadsheet property.

The following code snippet demonstrates how to add the Comment button to the Insert ribbon tab, to the new Comments group and bind it to the existing spreadsheet command which inserts a new comment.


A complete sample project is available in the DevExpress Code Examples database at https://supportcenter.devexpress.com/ticket/details/t511399/how-to-customize-the-integrated-ribbon-for-the-wpf-spreadsheet.

    <!--Create the Comments group on the Insert tab and add the Comment button to it.-->
    <dxb:InsertAction Index="5" ContainerName="{x:Static dxsps:DefaultBarItemNames.RibbonPage_Insert}">
        <dxr:RibbonPageGroup Caption="Comments">
            <dxb:BarButtonItem Content="Comment"
                               LargeGlyph="{dxsps:SpreadsheetSvgImage Name=InsertComment.svg, UseOfficeImage=True}"
                               Command="{Binding RelativeSource={RelativeSource Self}, Path=(dxsps:SpreadsheetControl.Spreadsheet).CommandProvider.InsertComment}"/>
See Also