Back to Devexpress

ASPxSpreadsheet.CreateDefaultRibbonTabs(Boolean) Method

aspnet-devexpress-dot-web-dot-aspxspreadsheet-dot-aspxspreadsheet-dot-createdefaultribbontabs-x28-system-dot-boolean-x29.md

latest3.8 KB
Original Source

ASPxSpreadsheet.CreateDefaultRibbonTabs(Boolean) Method

Creates a collection of default Ribbon tabs, specifying what to do with tabs that already exist within the ASPxSpreadsheet.RibbonTabs collection.

Namespace : DevExpress.Web.ASPxSpreadsheet

Assembly : DevExpress.Web.ASPxSpreadsheet.v25.2.dll

NuGet Package : DevExpress.Web.Office

Declaration

csharp
public void CreateDefaultRibbonTabs(
    bool clearExistingTabs
)
vb
Public Sub CreateDefaultRibbonTabs(
    clearExistingTabs As Boolean
)

Parameters

NameTypeDescription
clearExistingTabsBoolean

true to delete existing tabs; false to add the default tabs to the collection.

|

Remarks

Use the CreateDefaultRibbonTabs method, to manually create a default set of Ribbon tabs within the ASPxSpreadsheet. The method’s clearExistingTabs parameter allows you to specify how tabs that already exist within the ASPxSpreadsheet.RibbonTabs collection are dealt with.

Custom tabs can be added to the ASPxSpreadsheet.RibbonTabs collection using the collection’s Collection<T>.Add method.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CreateDefaultRibbonTabs(Boolean) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-spreadsheet-download-file-on-custom-ribbon-item-click/CS/ASPxSpreadsheetBinding/Default.aspx.cs#L43

csharp
void SetupSpreadsheetRibbon() {
    Spreadsheet.CreateDefaultRibbonTabs(true);
    Spreadsheet.RibbonTabs.Find(p => p.Text == "File").Visible = false;

asp-net-web-forms-spreadsheet-download-file-on-custom-ribbon-item-click/VB/ASPxSpreadsheetBinding/Default.aspx.vb#L54

vb
Private Sub SetupSpreadsheetRibbon()
    Spreadsheet.CreateDefaultRibbonTabs(True)
    Spreadsheet.RibbonTabs.Find(CType(Function(p) Equals(p.Text, "File"), Predicate(Of RibbonTab))).Visible = False

See Also

Custom Ribbon

ASPxSpreadsheet Class

ASPxSpreadsheet Members

DevExpress.Web.ASPxSpreadsheet Namespace