Skip to main content
A newer version of this page is available. .

Getting Started

  • 2 minutes to read

This tutorial describes how to create a simple spreadsheet application with a Ribbon interface.

  1. Start Visual Studio and create a new Windows Forms Application project by selecting FILE | New | Project… in the main menu. In the invoked New Project window, select Windows Forms Application, specify the name of the project, and click OK.

    Spreadsheet_CreateNewProject

  2. Drop the SpreadsheetControl item from the DX.17.2: Spreadsheet toolbox tab onto the form.

    SpreadsheetControl_DropFromToolbox

  3. Click the SpreadsheetControl’s smart tag and select Dock in Parent Container in the invoked SpreadsheetControl Tasks menu.

    SpreadsheetControl_Dock

  4. Select Create FormulaBar in the SpreadsheetControl Tasks menu. This will automatically add the SpreadsheetNameBoxControl and SpreadsheetFormulaBarControl controls onto the form, bind them to the SpreadsheetControl, and position them above the spreadsheet work area.

    SpreadsheetControl_CreateFormulaBar

  5. Select Create Ribbon in the SpreadsheetControl Tasks menu. This will add a RibbonControl onto the form and automatically position it above the spreadsheet name box and formula bar.

    SpreadsheetControl_CreateRibbon

  6. Select Create All Bars in the SpreadsheetControl Tasks menu to add all available spreadsheet Ribbon pages at once.

    SpreadsheetControl_CreateAllBars

  7. The spreadsheet application is ready now. Run it to view the result. For example, enter data in a cell, try creating a formula and formatting cells, and explore various Ribbon items.

    SpreadsheetControl_GettingStarted_Result

Note

Commands executed via the Bar (Ribbon) user interface can throw unhandled exceptions if a problem occurs. Consider the situation when a document is being saved to a locked or read-only file. To prevent application failure, subscribe to the SpreadsheetControl.UnhandledException event and set the SpreadsheetUnhandledExceptionEventArgs.Handled property to true.

For more examples on how to work with the SpreadsheetControl, refer to the Examples section.