Converting an Existing Data Grid

In this sample project, we will create a standard Data Grid, convert it to a C1FlexGrid, and do a few customizations, including merging cells.

Creating a standard Data Grid

  1. In the Solution Explorer, double-click on NORTHWINDData and add the Customers table.
  2. Right-click on the Screens folder and choose Add Screen. The Add New Screen window opens.
  3. Select Editable Grid Screen.
  4. Under Provide screen information, select NORTHWINDData.Customers from the Screen Data drop-down list.
    The Solution Explorer will look like this:
  5. Open the Designer and click Edit Query.

  6. Choose Sort and set the following criteria:
    Sort by: Country                               Ascending
    Sort by: City                                     Ascending
    Sort by: CompanyName                  Ascending
  7. Return to the Designer and further edit the screen layout.
    • Drag the Country field to the top.
    • Drag the City field under it.
    • Delete the CustomerID field, and all of the fields under Address.
    The screen layout should look like this:

Converting the built-in Data Grid

  1. Click the drop-down next to Data Grid and choose C1DataGrid.
  2. Now click the drop-down next to Country, City, Contact Name, and Contact Table and switch it to a FlexGrid Text Column. Switch Company Name to a FlexGrid Link Column.
  3. Select the Country element. In the Properties area, click on Appearance and select the Allow Merging check box. Set the Background Color to C0EAEFF4.
  4. Do the same for the City element.
  5. Choose C1FlexGrid and in the Properties area, click on Advanced and select the Merge Cells check box. Click the Show Grid Lines drop-down and choose All. Choose the Grid Lines Color drop-down and choose a medium gray.
  6. Run the Application.

    The Country and City fields are merged, and the proper background colors have been applied. Clicking a Company Name link will open a new tab for editing the data row for that customer.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback