Welcome to LightSwitch Desktop Edition > FlexGrid for LightSwitch Overview > FlexGrid for LightSwitch Quick Start > A Simple FlexGrid Application |
To create the simplest FlexGrid for LightSwitch application, start by creating a new LightSwitch application, and then add a data source and a FlexGrid Screen.
Create a FlexGrid for LightSwitch project
To create a new FlexGrid for LightSwitch project, complete the following steps:
Add a Data Source
To add an existing data source to the project, follow these steps:
Add a FlexGrid Screen
The Solution Explorer will look like this:
Run the application and you will see an interface similar to the one in Microsoft Excel.
In debug mode, you can click the Design Screen button to customize the page. If you select the C1FlexGridPage from the left-side menu at run time, you can customize various properties, including options specific to ComponentOne's product. In release mode, the Design Screen button is not available.
We have not done any customization so far, but we can take a look at the features automatically added by ComponentOne FlexGrid. Click the Cancel button at the top right in Customization Mode to return to the FlexGrid.
Filtering
The right edge of each column header now includes a dropdown filter menu containing the unique values for that column. To filter the column, select the desired items, and then click Apply.
To filter by an expression, click Conditions >> to switch the menu to a form where you can specify simple expressions instead of selecting specific values. See Filtering Data for more information.
Printing
The C1FlexGrid includes a Print button in the command bar. To print this grid at runtime, click the Print button. The Print button sends the current view to the printer, including rows that are scrolled out of view. See Printing a Grid for more information.
Selecting a Range and Copying that Data to the Clipboard
C1FlexGrid allows you to select adjacent columns or cells and copy the data within them to the clipboard.
To select entire rows, click within the record selector column on the far left. To select consecutive rows, use Shift-Click to choose the range. Copy the data to the clipboard using Ctrl-C.
You can select individual cells by clicking on them, or use Shift-Click to select a range. You cannot select columns or rows that are not adjacent to each other.
The following sections describe additional functionality that you can enable without writing any code.