FlexSheet for WPF | ComponentOne
Working with C1FlexSheet / Inserting Worksheets in FlexSheet
In This Topic
    Inserting Worksheets in FlexSheet
    In This Topic

    FlexSheet for WPF is not limited to a single sheet. Multiple worksheets, with an Excel-like tabbed interface, can be added to the C1FlexSheet control by using AddSheet method. The following lines of codes illustrate how to add worksheets to the C1FlexSheet control:

    1. Add C1FlexSheet control to the application using the following code in XAML View:
      XAML
      Copy Code
      <c1:C1FlexSheet x:Name="flex" Margin="0,25,0,0"></c1:C1FlexSheet>
      

    2. Add multiple sheets to the C1FlexSheet control by adding the following lines of codes just after the InitializeComponent() method in Code view:
      flex.AddSheet("Sheet1", 50, 10)
      ' Sheet 1 with 50 rows and 10 columns
      flex.AddSheet("Sheet2", 20, 10)
      flex.AddSheet("Sheet3", 50, 10)
      
      flex.AddSheet("Sheet1", 50, 10);// Sheet 1 with 50 rows and 10 columns
      flex.AddSheet("Sheet2", 20, 10);
      flex.AddSheet("Sheet3", 50, 10);
      flex.AddSheet("Sheet4", 50, 10);
      

    Here's how a Multi-tabbed FlexSheet looks like:

    Adding Sheets

    You can also insert sheets or add tabs in C1FlexSheet control at runtime by clicking the Tab button on the Tab Strip, as shown in the image below:

    Tab strip