Customize the Spreadsheet Status Bar
- 2 minutes to read
In This Article
This topic describes how to customize the Spreadsheet control’s status bar.
#Show or Hide Predefined Items
Use the following properties to control the visibility of the status bar’s elements:
Property | Description |
---|---|
Spreadsheet |
Specifies whether to display the progress bar. |
Spreadsheet |
Specifies whether to display the average value of the selected cells. |
Spreadsheet |
Specifies whether to display the number of selected cells that contain data. |
Spreadsheet |
Specifies whether to display the number of selected cells that contain numerical data. |
Spreadsheet |
Specifies whether to display the minimum numerical value in the selected cells. |
Spreadsheet |
Specifies whether to display the maximum numerical value in the selected cells. |
Spreadsheet |
Specifies whether to display the sum of numerical values in the selected cells. |
Spreadsheet |
Specifies whether to display the current zoom level. |
Spreadsheet |
Specifies whether to display the zoom slider that allows users to zoom the worksheet. |
Spreadsheet |
Specifies whether to display the End Mode label used to indicate that End Mode is activated. |
Spreadsheet |
Specifies whether to display the context menu that allows users to show or hide status bar entries. |
The following example shows how to hide the MIN and MAX items on the status bar:
<dxsps:SpreadsheetControl ShowStatusBar="True"
StatusBarShowMax="False"
StatusBarShowMin="False"/>
#Use Bar Customization Actions
Add the InsertAction, RemoveAction or UpdateAction customization actions to the SpreadsheetControl.StatusBarActions collection to add or remove the status bar’s items. An action’s ElementName property specifies a modified element’s name. The DevExpress.Xpf.Spreadsheet.DefaultBarItemNames class fields define the available element names.
The status bar’s element names | The Customize Status Bar context menu’s element names |
---|---|
Default Default Default Default Default Default Default Default Default Default Default |
Default Default Default Default Default Default Default Default Default Default Default Default |
The example below shows how to add a custom File Name item to the status bar and remove the predefined Min and Max items.
<!--Add the following namespace declarations:
xmlns:dxsps="http://schemas.devexpress.com/winfx/2008/xaml/spreadsheet"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"-->
<dxsps:SpreadsheetControl x:Name="spreadsheetControl"
CommandBarStyle="Ribbon"
ShowFormulaBar="True"
ShowStatusBar="True" >
<dxsps:SpreadsheetControl.StatusBarActions>
<!--Remove the MIN and MAX items from the status bar.-->
<dxb:RemoveAction ElementName="{x:Static dxsps:DefaultBarItemNames.StatusBarItem_Min}"/>
<dxb:RemoveAction ElementName="{x:Static dxsps:DefaultBarItemNames.StatusBarItem_Max}"/>
<!--Remove the MIN and MAX items from the Customize Status Bar context menu.-->
<dxb:RemoveAction ElementName="{x:Static dxsps:DefaultBarItemNames.StatusBarItem_PopupMenu_Min}"/>
<dxb:RemoveAction ElementName="{x:Static dxsps:DefaultBarItemNames.StatusBarItem_PopupMenu_Max}"/>
<!--Add the File Name item to the status bar. This item displays a path to the current workbook.-->
<dxb:InsertAction ContainerName="{x:Static dxsps:DefaultBarItemNames.StatusBarControl}" CollectionTag="LeftStatusBarItems">
<dxb:BarStaticItem Content="{Binding ElementName=spreadsheetControl, Path=Options.Save.CurrentFileName, Mode=OneWay}"
IsVisible="{Binding ElementName=showFileName, Path=IsChecked}"/>
</dxb:InsertAction>
<!--Add the File Name item to the Customize Status Bar context menu.
This item allows users to control the File Name item's visibility on the status bar.-->
<dxb:InsertAction ContainerName="{x:Static dxsps:DefaultBarItemNames.StatusBar_PopupMenu}">
<dxb:BarCheckItem x:Name="showFileName" Content="File Name" IsChecked="True"/>
</dxb:InsertAction>
</dxsps:SpreadsheetControl.StatusBarActions>
</dxsps:SpreadsheetControl>