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.1.dll
NuGet Package: DevExpress.Wpf.Spreadsheet
Declaration
Property Value
Type | Description |
---|---|
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:
- Creates the Comments ribbon group and adds it to the Insert ribbon tab.
- Creates the Comment button and adds it to the Comments ribbon group.
- Binds the Comment button to the existing spreadsheet command that 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