Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SpreadsheetControl.CommandProvider Property

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

Namespace: DevExpress.Xpf.Spreadsheet

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

NuGet Package: DevExpress.Wpf.Spreadsheet

#Declaration

public CommandProvider CommandProvider { get; set; }

#Property Value

Type Description
DevExpress.Xpf.Spreadsheet.CommandProvider

A DevExpress.Xpf.Spreadsheet.CommandProvider object.

#Remarks

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.

<dxsps:SpreadsheetControl.RibbonActions>
    <!--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}"
                               Command="{Binding RelativeSource={RelativeSource Self}, Path=(dxsps:SpreadsheetControl.Spreadsheet).CommandProvider.InsertComment}"/>
        </dxr:RibbonPageGroup>
    </dxb:InsertAction>
</dxsps:SpreadsheetControl.RibbonActions>
See Also