Skip to main content

Customize the Spreadsheet Status Bar

  • 2 minutes to read

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
SpreadsheetControl.StatusBarShowProgress Specifies whether to display the progress bar.
SpreadsheetControl.StatusBarShowAverage Specifies whether to display the average value of the selected cells.
SpreadsheetControl.StatusBarShowCount Specifies whether to display the number of selected cells that contain data.
SpreadsheetControl.ShowNumericalCount Specifies whether to display the number of selected cells that contain numerical data.
SpreadsheetControl.StatusBarShowMin Specifies whether to display the minimum numerical value in the selected cells.
SpreadsheetControl.StatusBarShowMax Specifies whether to display the maximum numerical value in the selected cells.
SpreadsheetControl.StatusBarShowSum Specifies whether to display the sum of numerical values in the selected cells.
SpreadsheetControl.StatusBarShowZoom Specifies whether to display the current zoom level.
SpreadsheetControl.StatusBarShowZoomSlider Specifies whether to display the zoom slider that allows users to zoom the worksheet.
SpreadsheetControl.StatusBarShowEndMode Specifies whether to display the End Mode label used to indicate that End Mode is activated.
SpreadsheetControl.StatusBarShowPopupMenu 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
DefaultBarItemNames.StatusBarControl
DefaultBarItemNames.StatusBarItem_Progress
DefaultBarItemNames.StatusBarItem_Average
DefaultBarItemNames.StatusBarItem_Count
DefaultBarItemNames.StatusBarItem_NumericalCount
DefaultBarItemNames.StatusBarItem_Min
DefaultBarItemNames.StatusBarItem_Max
DefaultBarItemNames.StatusBarItem_Sum
DefaultBarItemNames.StatusBarItem_Zoom
DefaultBarItemNames.StatusBarItem_ZoomSlider
DefaultBarItemNames.StatusBarItem_EndMode
DefaultBarItemNames.StatusBar_PopupMenu
DefaultBarItemNames.StatusBarItem_PopupMenu_Header
DefaultBarItemNames.StatusBarItem_PopupMenu_Progress
DefaultBarItemNames.StatusBarItem_PopupMenu_Average
DefaultBarItemNames.StatusBarItem_PopupMenu_Count
DefaultBarItemNames.StatusBarItem_PopupMenu_NumericalCount
DefaultBarItemNames.StatusBarItem_PopupMenu_Min
DefaultBarItemNames.StatusBarItem_PopupMenu_Max
DefaultBarItemNames.StatusBarItem_PopupMenu_Sum
DefaultBarItemNames.StatusBarItem_PopupMenu_Zoom
DefaultBarItemNames.StatusBarItem_PopupMenu_ZoomSlider
DefaultBarItemNames.StatusBarItem_PopupMenu_EndMode

The example below shows how to add a custom File Name item to the status bar and remove the predefined Min and Max items.

Spreadsheet_Customize_Status_Bar

<!--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>