FlexSheet for WPF | ComponentOne
Quick Start: FlexSheet for WPF / Step 1 of 3: Setting up the Application
In This Topic
    Step 1 of 3: Setting up the Application
    In This Topic

    In this step, you begin with creating a WPF application in Visual Studio and then adding a FlexSheet control to your application.

    In Design View

    To add a FlexSheet to your WPF application in Design view, perform the following steps:

    1. Create a new WPF project in Visual Studio.
    2. Navigate to the Toolbox and locate the C1FlexSheet control icon.
    3. Double-click the C1FlexSheet icon to add the control to the MainWindow. The control looks like the following:

      FlexSheet control added to design view

    In Code

    To add a FlexSheet to your WPF application in Code view, perform the following steps:

    1. Set the Name property of the Grid in XAML so that the control has a unique identifier to call in code. In our case, Name property of the Grid control is set to Parent, as shown in the following code:

      XAML
      Copy Code
      <Grid Name="Parent">
      </Grid>
      
    2. Add the following namespaces in Code view:

      Imports C1.WPF
      Imports C1.WPF.FlexGrid
      
      using C1.WPF;
      using C1.WPF.FlexGrid;
      
    3. Add the following lines of code beneath the InitializeComponent() method to add the FlexSheet control:

      Dim flex = New C1FlexSheet()
      Parent.Children.Add(flex)
      
      var flex = new C1FlexSheet();
      Parent.Children.Add(flex);