How can I remove the "File" RibbonTab?

P1.png

<syncfusion:RibbonWindow

    x:Class="syncfusion.spreadsheetdemos.wpf.GettingStarted"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:Interactivity="http://schemas.microsoft.com/xaml/behaviors"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:local="clr-namespace:syncfusion.spreadsheetdemos.wpf"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    xmlns:syncfusion="http://schemas.syncfusion.com/wpf"

    xmlns:syncfusionskin="clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF"

syncfusionskin:SfSkinManager.VisualStyle="Office2013White"

    Width="1024"

    Height="750"

    DataContext="{Binding ElementName=spreadsheetControl}"

    WindowStartupLocation="CenterScreen"

    WindowState="Maximized"

    mc:Ignorable="d" VerticalAlignment="Top" HorizontalAlignment="Left">


 <Grid >

     <Grid.RowDefinitions>

         <RowDefinition Height="Auto" />

         <RowDefinition Height="*" />

     </Grid.RowDefinitions>

     <syncfusion:SfSpreadsheetRibbon x:Name="sfSpreadsheetRibbon" DataContext="{Binding ElementName=spreadsheetControl}"

                                 VerticalAlignment="Top"

                                 HorizontalAlignment="Left"

                                 Loaded="sfSpreadsheetRibbon_Loaded"

                                 />

     <syncfusion:SfSpreadsheet

     x:Name="spreadsheetControl"

     Grid.Row="1"

     FormulaBarVisibility="Visible">

     </syncfusion:SfSpreadsheet>

 </Grid>


</syncfusion:RibbonWindow>



1 Reply 1 reply marked as answer

SB Sweatha Bharathi Syncfusion Team August 6, 2025 12:59 PM UTC

Hi David Chiang,


We have reviewed your query. We have an option to hide the File tab and add a custom tab in SfSpreadsheet.

Solution 1: Remove the File tab in Ribbon

                      We can hide the File tab by accessing the BackStageButton from the ribbon and setting its visibility to Collapsed.

Code snippet to remove File tab in Ribbon:

 private void sfSpreadsheetRibbon_Loaded(object sender, RoutedEventArgs e)

 {

     var ribbon1 = GridUtil.GetVisualChild<Ribbon>(sender as FrameworkElement);

     if (ribbon1 == null)

         return;

     if (ribbon1 != null && ribbon1.BackStageButton != null)

         ribbon1.BackStageButton.Visibility = Visibility.Collapsed;

 }


Image Reference:

A screenshot of a computer

AI-generated content may be incorrect.


Solution 2:  Add the Custom Tab in Ribbon

You can also create your own custom NEWFILE menu by using a Ribbon tab and adding it to the ribbon items. Additionally, you can add buttons inside the NEWFILE menu using RibbonButton. Based on your specific needs, you can customize the RibbonTab and RibbonButtons accordingly.


Code snippet to add custom tab in Ribbon:

private void sfSpreadsheetRibbon_Loaded(object sender, RoutedEventArgs e)

{

    var ribbon1 = GridUtil.GetVisualChild<Ribbon>(sender as FrameworkElement);

    if (ribbon1 == null)

        return;

 

    //To add the custom tab

 

    RibbonTab ribbonTab = new RibbonTab();

    ribbonTab.Caption = "NEWFILE";

 

    RibbonButton Button1 = new RibbonButton() { Label = "Save" };

    RibbonButton Button2 = new RibbonButton() { Label = "Open" };

 

    var customRibbonBar = new RibbonBar()

    {

        Header = "Options",

        IsLauncherButtonVisible = false

    };

    customRibbonBar.Items.Add(Button1);

    customRibbonBar.Items.Add(Button2);

    ribbonTab.Items.Add(customRibbonBar);

 

    // Insert at beginning instead of appending

    ribbon1.Items.Insert(0, ribbonTab);

}


Image Reference:


A screenshot of a computer

AI-generated content may be incorrect.


Find the sample demo in the attachment an let us know if you have any concerns on this.

Note : We have provided an two solution of removing the File tab and adding the custom tab in ribbon , based on your needs you can use the solutions.

If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Regards,

Sweatha B



Attachment: SpreadsheetDemo_915bab39.zip

Marked as answer
Loader.
Up arrow icon