Skip to main content
InSource KnowledgeCenter

TN AppSvr173 How to use the Microsoft.net Datagridview control in Application Server

insource logo large.jpg

 

Description

How to use the Microsoft.net Datagridview control in Application Server

 

  • Author: Mike Viteri
  • Published: 11/12/2015
  • Applies to: Application 3.0 and greater

 

 

Details

You can start using the DataGridView Control from the Microsoft.net Framework. You have to import it into the Galaxy.


This can be done by inside the IDE going to Galaxy->Import->Client Control.

 

 

Then you have to browse to C:\Windows\Microsoft.NET\Framework\v4.0.30319 then import the system.windows.forms

 

then import the system.windows.forms

 

 

The Import will Start

 

 

Then finish

 

 

 

 

You will then see the import controls under the Graphic Toolbox

 

 

Create a new symbol in your graphic toolbox. We called our symbol testgrid in this example.

 

 

Open your new symbol and click on the embed Archestra Graphic button. Then from the Graphic Toolbox select "DataGridView".

 

 

This is what the embedded DataGridView will look like.

 

 

 

I have setup and deployed a user defined object called "datagridtest". It has three UDA's of CarMaker, CarColor and CarType. Each is an array with data below. We will use this data to populate the DataGridView.

 

 Create an "OnShow' Archestra Graphic script that will populate the columns of the grid. It will be a three column grid.

 

dataGridView1.ColumnCount = 3;
dataGridView1.ColumnHeadersVisible = true;
dataGridView1.Columns[0].Name = "CarMaker";
dataGridView1.Columns[1].Name = "CarColor";
dataGridView1.Columns[2].Name = "CarType";

 

 

If you embed the symbol on an Intouch window and go to runtime. You will see this below.

 

 

Next add the script to read the row data from the datagridtest  UDA's. This script adds a row of data when reading each UDA name and array.

 

datagridview1.Rows.Add(datagridtest.CarMaker[1],datagridtest.CarColor[1],datagridtest.CarType[1]);
datagridview1.Rows.Add(datagridtest.CarMaker[2],datagridtest.CarColor[2],datagridtest.CarType[2]);
datagridview1.Rows.Add(datagridtest.CarMaker[3],datagridtest.CarColor[3],datagridtest.CarType[3]);

 

 

 

 

Now if you go to runtime again on the DataGridView you should see the data that is being read of the object.

 

 

 

All functions of the DataGridView Control can be found here:

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview(v=vs.110).aspx