Back to Devexpress

SpreadsheetControl.CommandProvider Property

wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcontrol-3917a485.md

latest2.7 KB
Original Source

SpreadsheetControl.CommandProvider Property

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

Namespace : DevExpress.Xpf.Spreadsheet

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

NuGet Package : DevExpress.Wpf.Spreadsheet

Declaration

csharp
public CommandProvider CommandProvider { get; set; }
vb
Public Property CommandProvider As CommandProvider

Property Value

TypeDescription
DevExpress.Xpf.Spreadsheet.CommandProvider

A DevExpress.Xpf.Spreadsheet.CommandProvider object.

|

Remarks

This class stores commands used by the integrated ribbon and allows you to assign a command to a ribbon item. Use the SpreadsheetControl.Spreadsheet property to access the SpreadsheetControl in binding syntax.

The code snippet below performs the following actions:

  1. Creates the Comments ribbon group and adds it to the Insert ribbon tab.
  2. Creates the Comment button and adds it to the Comments ribbon group.
  3. Binds the Comment button to the existing spreadsheet command that inserts a new comment.
xaml
<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

Customize the Integrated Ribbon UI for the Spreadsheet

SpreadsheetControl Class

SpreadsheetControl Members

DevExpress.Xpf.Spreadsheet Namespace