Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Retrieve tag properties programmatically.

ReferenceCodeCode Library → Tag Get Properties


Tag Get Properties Code show

Overview

This example show how to access TagProperties from CodeBehind.

The Method use it TK. TK.GetTagChildrenAsDataRow()

Return Value:  DataRow[] On this page:

Table of Contents
maxLevel

3

2
minLevel2
indent10px
excludeSteps
stylenone


Get DataRows method

The key for this is implementation is the method, which gets the the children from any folder as DataRow[], with each property in a column:

Code Block
languagec#
titleGet Tag Children
	DataTable table = new DataTable("Table1");
	table.Columns.Add("Name", typeof(string));
	table.Columns.Add("TypeName", typeof(string));

	// This call will get all tags from the root folder
	// In order to get tags from other folders, or domains, modify the paremeters of GetChildren Methods 
	DataRow[] rows =  TK.GetTagChildrenAsDataRow();
	
	// just fore verification
	int j = rows.Length;
	
	foreach (DataRow row in rows)
	{
		// In this example, we are getting only the Name and Type, all columns from UnsTas tables can be accessed using this method
		string name = TK.ToText(row["Name"]);		
		int type = TK.ToInt(row["Type"]);
		
	    string typeName = await TK.GetElementTypeAsync(name);		
		table.Rows.Add(name, typeName);		
	}//foreach
	

Solution Example

Download example: GetTagProperties.dblsn



In this section...

Page Tree
V10
rootV10:@parentspaces