Skip to main content Skip to footer

How to Populate FlexGrid, FlexPivot, and FlexChart in CRM Without Code

Using the Visual Studio design-time integration for ComponentOne DataConnectors, we can populate FlexGrid, FlexPivot, and FlexChart controls without writing a single line of code.

Our DataConnectors come with built-in Visual Studio integration so that you can easily connect to online data sources such as Salesforce, Dynamics 365 Sales, OData, QuickBooks, and Kintone through Server Explorer. This code-less integration allows you to drag and drop tables on a dataset in the designer and connect to data-aware controls like grids, charts, and report designers such as Crystal Reports.

Prerequisites

You need to download the latest version of the ComponentOne Control Panel on your system and ensure that ComponentOne Data Services is installed up to the latest available version.

Data Services

Want to Populate FlexGrid from Your CRM without Writing a Single Line of Code? Try it Out with ComponentOne Today!

Steps to Populate the Datagrid

After installation, DataConnectors will integrate into Visual Studio. The steps below describe how to create a database connection and populate a WinForms datagrid:

Begin by opening a WinForms Application in Visual Studio. From the “View” tab, select “Server Explorer.”

Real

In the Server Explorer, select Data Connections and click the “Add Connection” icon to connect to the database, as shown in the following image: 

Explorer

The “Add Connection” window will open. Next to “Data source:”, click on the “Change…” button.

Connection

In the “Choose Data Source” dialog, choose a new data source and/or ADO.NET data provider and click “OK”. In this example, we chose “C1 ODATA Data Source” to connect to the OData service. At this point, you may be asked by the new provider for credentials, depending on how it’s configured.

Data Source

In the “Add Connection” dialog, navigate to the “ConnectionString” property under “Data”, enter your connection string (without cache settings) and click “Test Connection,” as shown in the image below. Determine the cache settings in code or through the connection string in the configuration file.

Modify

Now that we have a successful connection, click “OK”. You can view the connected database (as shown in the following image) and create a new data source:

Service

In the design view, drag and drop DataGridView control on the Form.

Windows Forms

Select the DataGridView control and click on the smart tag in the top-right corner to open the “C1DataGridView Tasks” menu. 

Select

Click on the “Choose Data Source” drop-down button and select the “Add Project Data Source…” option to open the “Data Source Configuration Wizard.” 

Dataview Grid

On the “Choose a Data Source Type” page, select “Database” and click “Next.’

Data Source

On the “Choose a Database Model” page, select “Dataset” and click “Next.”

Wizard

On the “Choose Your Data Connection” page, click “Next” as your data connection is already set as “C1 OData [OData Server V4].” 

Connection

Save the connection string in the application configuration file by selecting the “Yes, save the connection as” check box.

String

Click “Next” to switch to the “Choose Your Database Objects” page.

Choose a table from the “Tables” node and click “Finish”.

Database

You now have a dataset added to your application – binding the DataGridView control to the selected table from the data source without writing a line of code.

Results

Want to Populate FlexGrid from Your CRM without Writing a Single Line of Code? Try it Out with ComponentOne Today!

comments powered by Disqus