DataGridAddTextBoxColumn

 

The 'DataGridAddTextBoxColumn' function adds the string column to DataGrid object.

 

void @DataGridAddTextBoxColumn(string class_name, string column_name, string column_text, string data_name);

 

Parameters

string class_name : Class name of DataGrid object.

string column_name : Column name. (You can set the string Column name firstly by using this function. If you refer to Column which is related to other Grid function, you have to use Column name which is set by this function.

string column_text : Displayed text on Column at DataGrid object.

string data_name : Column name about data to connect. (It is part to enter the Column name of database, when DataGrid object is created by database.)

 

Return Value

None

 

Example 1 (In case of interworking the data at database)

<Assumption>

Class name of DataGrid object which was entered at Studio is 'DataGrid1', and database connection string to interwork is 'Dsn1'. You can interwork the below Access data by using database connection string 'Dsn1'.

 

 

<Contents of the script>

@DataGridSetDsn("DataGrid1", "Dsn1");            // Interworking the new database connection string to DataGrid object

@DataGridClearColumn("DataGrid1");                // Delete all Column of DataGrid object

@DataGridAddTextBoxColumn("DataGrid1", "ID", "ID", "ID");                            // Create the 'ID' Column

@DataGridAddTextBoxColumn("DataGrid1", "NAME", "Field1", "NAME");               // Create the 'NAME' Column
@DataGridAddTextBoxColumn("DataGrid1", "TEL", "Field2", "TEL");             // Create the 'TEL' Column
@DataGridAddTextBoxColumn("DataGrid1", "ADDRESS", "Field3", "ADDRESS");          // Create the 'ADDRESS' Column

@DataGridSetSelect("DataGrid1", "SELECT * FROM Table1");                             // Set the data to each Column
@DataGridReLoad("DataGrid1");                        // Reload the DataGrid object


<LocalMain program screen>

 

Example 2 (In case of not interworking the data at database)

<Assumption>

Class name of DataGrid object which was entered at Studio is 'DataGrid1', and data is created by script.

 

<Contents of the script>

@DataGridSetDsn("DataGrid1", ""); // Release the database connection string which was interworked with DataGrid object
@DataGridClearColumn("DataGrid1"); // Delete all Column of DataGrid object
@DataGridAddTextBoxColumn("DataGrid1", "ID", "ID", "ID"); // Create the 'ID' Column
@DataGridAddTextBoxColumn("DataGrid1", "NAME", "NAME", ""); //Create the 'NAME' Column
@DataGridAddTextBoxColumn("DataGrid1", "TEL", "TEL", ""); // Create the 'TEL' Column
@DataGridAddTextBoxColumn("DataGrid1", "ADDRESS", "ADDRESS", ""); // Create the 'ADDRESS' Column
index = @DataGridAddRow("DataGrid1"); // Create the row
@DataGridSetCellData("DataGrid1", 0, index, "1"); // Enter the data to specified cell
@DataGridSetCellData("DataGrid1", 1, index, "Lee Byunggyu"); // Enter the data to specified cell
@DataGridSetCellData("DataGrid1", 2, index, "111-1111"); //Enter the data to specified cell
@DataGridSetCellData("DataGrid1", 3, index, "SEOUL"); // Enter the data to specified cell
@DataGridReLoad("DataGrid1"); // Reload the DataGrid object

 

<LocalMain program screen>

 

Version Information

Supported Version : 10.2.4 or higher