property Column.FormatColumn as String
Specifies the format to display the cells in the column.

TypeDescription
String A string expression that defines the format to display the cell, including HTML formatting, if the cell supports it.
By default, the FormatColumn property is empty. The cells in the column use the specified format only if is valid ( not empty, and syntactically correct ), to display data in the column. The FormatColumn property provides a format to display all cells in the column using a predefined format. The expression may be a combination of variables, constants, strings, dates and operators, and value. The value operator gives the value to be formatted, while the state operator indicates the cell's state.  A string is delimited by ", ` or ' characters, and inside they can have the starting character preceded by \ character, ie "\"This is a quote\"". A date is delimited by # character, ie #1/31/2001 10:00# means the January 31th, 2001, 10:00 AM. The FormatCell property specifies the caption to be displayed on a specified cell. 

For instance:

The value keyword in the property indicates the value to be formatted. The Value property specifies the cell's value.

The state keyword in the property indicates the cell's state. The State property specifies the cell's state, which can be 0, 1 or 2.

The supported binary arithmetic operators are:

The supported unary boolean operators are:

The supported binary boolean operators are:

The supported binary boolean operators, all these with the same priority 0, are :

The supported ternary operators, all these with the same priority 0, are :

"expression ? true_part : false_part"

, while it executes and returns the true_part if the expression is true, else it executes and returns the false_part. For instance, the "%0 = 1 ? 'One' : (%0 = 2 ? 'Two' : 'not found')" returns 'One' if the value is 1, 'Two' if the value is 2, and 'not found' for any other value. A n-ary equivalent operation is the case() statement, which is available in newer versions of the component.

The supported n-ary operators are (with priority 5):

"expression array (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "month(value)-1 array ('J','F','M','A','M','Jun','J','A','S','O','N','D')" is equivalent with "month(value)-1 case (default:''; 0:'J';1:'F';2:'M';3:'A';4:'M';5:'Jun';6:'J';7:'A';8:'S';9:'O';10:'N';11:'D')". 

"expression in (c1,c2,c3,...cn)"

, where the c1, c2, ... are constant elements. The constant elements could be numeric, date or string expressions. For instance the "value in (11,22,33,44,13)" is equivalent with "(expression = 11) or (expression = 22) or (expression = 33) or (expression = 44) or (expression = 13)". The in operator is not a time consuming as the equivalent or version is, so when you have large number of constant elements it is recommended using the in operator. Shortly, if the collection of elements has 1000 elements the in operator could take up to 8 operations in order to find if an element fits the set, else if the or statement is used, it could take up to 1000 operations to check, so by far, the in operator could save time on finding elements within a collection.

"expression switch (default,c1,c2,c3,...,cn)"

, where the c1, c2, ... are constant elements, and the default is a constant element being returned when the element is not found in the collection. The constant elements could be numeric, date or string expressions.  The equivalent syntax is "%0 = c 1 ? c 1 : ( %0 = c 2 ? c 2 : ( ... ? . : default) )". The switch operator is very similar with the in operator excepts that the first element in the switch is always returned by the statement if the element is not found,  while the returned value is the value itself instead -1. For instance, the "%0 switch ('not found',1,4,7,9,11)" gets 1, 4, 7, 9 or 11, or 'not found' for any other value. As the in operator the switch operator uses binary searches for fitting the element, so it is quicker that iif (immediate if operator) alterative.

"expression case ([default : default_expression ; ] c1 : expression1 ; c2 : expression2 ; c3 : expression3 ;....)"

If the default part is missing, the case() operator returns the value of the expression if it is not found in the collection of cases ( c1, c2, ...). For instance, if the value of expression is not any of c1, c2, .... the default_expression is executed and returned. If the value of the expression is c1, then the case() operator executes and returns the expression1. The default, c1, c2, c3, ... must be constant elements as numbers, dates or strings. For instance, the "date(shortdate(value)) case (default:0 ; #1/1/2002#:1 ; #2/1/2002#:1; #4/1/2002#:1; #5/1/2002#:1)" indicates that only #1/1/2002#, #2/1/2002#,  #4/1/2002# and  #5/1/2002# dates returns 1, since the others returns 0. For instance the following sample specifies the hour being non-working for specified dates: "date(shortdate(value)) case(default:0;#4/1/2009# : hour(value) >= 6 and hour(value) <= 12 ; #4/5/2009# : hour(value) >= 7 and hour(value) <= 10 or hour(value) in(15,16,18,22); #5/1/2009# : hour(value) <= 8)" statement indicates the working hours for dates as follows:

The in, switch and case() use binary search to look for elements so they are faster then using iif and or expressions.

Obviously, the priority of the operations inside the expression is determined by ( ) parenthesis and the priority for each operator. 

The supported conversion unary operators are:

Other known operators for numbers are:

Other known operators for strings are:

Other known operators for dates are:

Other known operators for auto-numbering are:

The expression supports also immediate if ( similar with iif in visual basic, or ? : in C++ ) ie cond ? value_true : value_false, which means that once that cond is true the value_true is used, else the value_false is used. Also, it supports variables, up to 10 from 0 to 9. For instance, 0:="Abc" means that in the variable 0 is "Abc", and =:0 means retrieves the value of the variable 0. You can use variables to avoid computing several times the same thing.

 

The following samples show how you can add a column that displays the position of the item in the hierarchy:

VBA (MS Access, Excell...)

With TreeCube1
	.BeginUpdate 
	With .FrontFace.CreateTree
		.ItemPadding = 10
		.LinesAtRoot = 2
		.DrawGridLines = -2
		.Columns.Add("Default").Alignment = 0
		With .Columns.Add("Pos")
			.Position = 0
			.Alignment = 0
			.FormatColumn = "1 rpos ``"
			.Width = 24
		End With
		With .Items
			With .Add("Root 1").Items
				.Add "Child 1"
				.Add "Child 2"
				.Add "Child 3"
			End With
			With .Add("Root 2").Items
				.Add "Child 1"
				.Add "Child 2"
				.Add "Child 3"
			End With
			.ExpandAll 
		End With
	End With
	.EndUpdate 
End With

VB6

With TreeCube1
	.BeginUpdate 
	With .FrontFace.CreateTree
		.ItemPadding = 10
		.LinesAtRoot = exGroupLines
		.DrawGridLines = exRowLines
		.Columns.Add("Default").Alignment = LeftAlignment
		With .Columns.Add("Pos")
			.Position = 0
			.Alignment = LeftAlignment
			.FormatColumn = "1 rpos ``"
			.Width = 24
		End With
		With .Items
			With .Add("Root 1").Items
				.Add "Child 1"
				.Add "Child 2"
				.Add "Child 3"
			End With
			With .Add("Root 2").Items
				.Add "Child 1"
				.Add "Child 2"
				.Add "Child 3"
			End With
			.ExpandAll 
		End With
	End With
	.EndUpdate 
End With

VB.NET

With Extreecube1
	.BeginUpdate()
	With .FrontFace.CreateTree()
		.ItemPadding = 10
		.LinesAtRoot = exontrol.EXTREECUBELib.LinesAtRootEnum.exGroupLines
		.DrawGridLines = exontrol.EXTREECUBELib.GridLinesEnum.exRowLines
		.Columns.Add("Default").Alignment = exontrol.EXTREECUBELib.AlignmentEnum.LeftAlignment
		With .Columns.Add("Pos")
			.Position = 0
			.Alignment = exontrol.EXTREECUBELib.AlignmentEnum.LeftAlignment
			.FormatColumn = "1 rpos ``"
			.Width = 24
		End With
		With .Items
			With .Add("Root 1").Items
				.Add("Child 1")
				.Add("Child 2")
				.Add("Child 3")
			End With
			With .Add("Root 2").Items
				.Add("Child 1")
				.Add("Child 2")
				.Add("Child 3")
			End With
			.ExpandAll()
		End With
	End With
	.EndUpdate()
End With

VB.NET for /COM

With AxTreeCube1
	.BeginUpdate()
	With .FrontFace.CreateTree()
		.ItemPadding = 10
		.LinesAtRoot = EXTREECUBELib.LinesAtRootEnum.exGroupLines
		.DrawGridLines = EXTREECUBELib.GridLinesEnum.exRowLines
		.Columns.Add("Default").Alignment = EXTREECUBELib.AlignmentEnum.LeftAlignment
		With .Columns.Add("Pos")
			.Position = 0
			.Alignment = EXTREECUBELib.AlignmentEnum.LeftAlignment
			.FormatColumn = "1 rpos ``"
			.Width = 24
		End With
		With .Items
			With .Add("Root 1").Items
				.Add("Child 1")
				.Add("Child 2")
				.Add("Child 3")
			End With
			With .Add("Root 2").Items
				.Add("Child 1")
				.Add("Child 2")
				.Add("Child 3")
			End With
			.ExpandAll()
		End With
	End With
	.EndUpdate()
End With

C++

/*
	Copy and paste the following directives to your header file as
	it defines the namespace 'EXTREECUBELib' for the library: 'ExTreeCube 1.0 Control Library'

	#import <ExTreeCube.dll>
	using namespace EXTREECUBELib;
*/
EXTREECUBELib::ITreeCubePtr spTreeCube1 = GetDlgItem(IDC_TREECUBE1)->GetControlUnknown();
spTreeCube1->BeginUpdate();
EXTREECUBELib::IFaceTreePtr var_FaceTree = spTreeCube1->GetFrontFace()->CreateTree();
	var_FaceTree->PutItemPadding(10);
	var_FaceTree->PutLinesAtRoot(EXTREECUBELib::exGroupLines);
	var_FaceTree->PutDrawGridLines(EXTREECUBELib::exRowLines);
	var_FaceTree->GetColumns()->Add(L"Default")->PutAlignment(EXTREECUBELib::LeftAlignment);
	EXTREECUBELib::IColumnPtr var_Column = var_FaceTree->GetColumns()->Add(L"Pos");
		var_Column->PutPosition(0);
		var_Column->PutAlignment(EXTREECUBELib::LeftAlignment);
		var_Column->PutFormatColumn(L"1 rpos ``");
		var_Column->PutWidth(24);
	EXTREECUBELib::IItemsPtr var_Items = var_FaceTree->GetItems();
		EXTREECUBELib::IItemsPtr var_Items1 = var_Items->Add("Root 1")->GetItems();
			var_Items1->Add("Child 1");
			var_Items1->Add("Child 2");
			var_Items1->Add("Child 3");
		EXTREECUBELib::IItemsPtr var_Items2 = var_Items->Add("Root 2")->GetItems();
			var_Items2->Add("Child 1");
			var_Items2->Add("Child 2");
			var_Items2->Add("Child 3");
		var_Items->ExpandAll();
spTreeCube1->EndUpdate();

C++ Builder

TreeCube1->BeginUpdate();
Extreecubelib_tlb::IFaceTreePtr var_FaceTree = TreeCube1->FrontFace->CreateTree();
	var_FaceTree->ItemPadding = 10;
	var_FaceTree->LinesAtRoot = Extreecubelib_tlb::LinesAtRootEnum::exGroupLines;
	var_FaceTree->DrawGridLines = Extreecubelib_tlb::GridLinesEnum::exRowLines;
	var_FaceTree->Columns->Add(L"Default")->Alignment = Extreecubelib_tlb::AlignmentEnum::LeftAlignment;
	Extreecubelib_tlb::IColumnPtr var_Column = var_FaceTree->Columns->Add(L"Pos");
		var_Column->Position = 0;
		var_Column->Alignment = Extreecubelib_tlb::AlignmentEnum::LeftAlignment;
		var_Column->FormatColumn = L"1 rpos ``";
		var_Column->Width = 24;
	Extreecubelib_tlb::IItemsPtr var_Items = var_FaceTree->Items;
		Extreecubelib_tlb::IItemsPtr var_Items1 = var_Items->Add(TVariant("Root 1"))->Items;
			var_Items1->Add(TVariant("Child 1"));
			var_Items1->Add(TVariant("Child 2"));
			var_Items1->Add(TVariant("Child 3"));
		Extreecubelib_tlb::IItemsPtr var_Items2 = var_Items->Add(TVariant("Root 2"))->Items;
			var_Items2->Add(TVariant("Child 1"));
			var_Items2->Add(TVariant("Child 2"));
			var_Items2->Add(TVariant("Child 3"));
		var_Items->ExpandAll();
TreeCube1->EndUpdate();

C#

extreecube1.BeginUpdate();
exontrol.EXTREECUBELib.FaceTree var_FaceTree = extreecube1.FrontFace.CreateTree();
	var_FaceTree.ItemPadding = 10;
	var_FaceTree.LinesAtRoot = exontrol.EXTREECUBELib.LinesAtRootEnum.exGroupLines;
	var_FaceTree.DrawGridLines = exontrol.EXTREECUBELib.GridLinesEnum.exRowLines;
	var_FaceTree.Columns.Add("Default").Alignment = exontrol.EXTREECUBELib.AlignmentEnum.LeftAlignment;
	exontrol.EXTREECUBELib.Column var_Column = var_FaceTree.Columns.Add("Pos");
		var_Column.Position = 0;
		var_Column.Alignment = exontrol.EXTREECUBELib.AlignmentEnum.LeftAlignment;
		var_Column.FormatColumn = "1 rpos ``";
		var_Column.Width = 24;
	exontrol.EXTREECUBELib.Items var_Items = var_FaceTree.Items;
		exontrol.EXTREECUBELib.Items var_Items1 = var_Items.Add("Root 1").Items;
			var_Items1.Add("Child 1");
			var_Items1.Add("Child 2");
			var_Items1.Add("Child 3");
		exontrol.EXTREECUBELib.Items var_Items2 = var_Items.Add("Root 2").Items;
			var_Items2.Add("Child 1");
			var_Items2.Add("Child 2");
			var_Items2.Add("Child 3");
		var_Items.ExpandAll();
extreecube1.EndUpdate();

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:13A5B44B-DBB7-42F2-AE2B-943A6CF6C8B9" id="TreeCube1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	TreeCube1.BeginUpdate();
	var var_FaceTree = TreeCube1.FrontFace.CreateTree();
		var_FaceTree.ItemPadding = 10;
		var_FaceTree.LinesAtRoot = 2;
		var_FaceTree.DrawGridLines = -2;
		var_FaceTree.Columns.Add("Default").Alignment = 0;
		var var_Column = var_FaceTree.Columns.Add("Pos");
			var_Column.Position = 0;
			var_Column.Alignment = 0;
			var_Column.FormatColumn = "1 rpos ``";
			var_Column.Width = 24;
		var var_Items = var_FaceTree.Items;
			var var_Items1 = var_Items.Add("Root 1").Items;
				var_Items1.Add("Child 1");
				var_Items1.Add("Child 2");
				var_Items1.Add("Child 3");
			var var_Items2 = var_Items.Add("Root 2").Items;
				var_Items2.Add("Child 1");
				var_Items2.Add("Child 2");
				var_Items2.Add("Child 3");
			var_Items.ExpandAll();
	TreeCube1.EndUpdate();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:13A5B44B-DBB7-42F2-AE2B-943A6CF6C8B9" id="TreeCube1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With TreeCube1
		.BeginUpdate 
		With .FrontFace.CreateTree
			.ItemPadding = 10
			.LinesAtRoot = 2
			.DrawGridLines = -2
			.Columns.Add("Default").Alignment = 0
			With .Columns.Add("Pos")
				.Position = 0
				.Alignment = 0
				.FormatColumn = "1 rpos ``"
				.Width = 24
			End With
			With .Items
				With .Add("Root 1").Items
					.Add "Child 1"
					.Add "Child 2"
					.Add "Child 3"
				End With
				With .Add("Root 2").Items
					.Add "Child 1"
					.Add "Child 2"
					.Add "Child 3"
				End With
				.ExpandAll 
			End With
		End With
		.EndUpdate 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axTreeCube1.BeginUpdate();
EXTREECUBELib.FaceTree var_FaceTree = axTreeCube1.FrontFace.CreateTree();
	var_FaceTree.ItemPadding = 10;
	var_FaceTree.LinesAtRoot = EXTREECUBELib.LinesAtRootEnum.exGroupLines;
	var_FaceTree.DrawGridLines = EXTREECUBELib.GridLinesEnum.exRowLines;
	var_FaceTree.Columns.Add("Default").Alignment = EXTREECUBELib.AlignmentEnum.LeftAlignment;
	EXTREECUBELib.Column var_Column = var_FaceTree.Columns.Add("Pos");
		var_Column.Position = 0;
		var_Column.Alignment = EXTREECUBELib.AlignmentEnum.LeftAlignment;
		var_Column.FormatColumn = "1 rpos ``";
		var_Column.Width = 24;
	EXTREECUBELib.Items var_Items = var_FaceTree.Items;
		EXTREECUBELib.Items var_Items1 = var_Items.Add("Root 1").Items;
			var_Items1.Add("Child 1");
			var_Items1.Add("Child 2");
			var_Items1.Add("Child 3");
		EXTREECUBELib.Items var_Items2 = var_Items.Add("Root 2").Items;
			var_Items2.Add("Child 1");
			var_Items2.Add("Child 2");
			var_Items2.Add("Child 3");
		var_Items.ExpandAll();
axTreeCube1.EndUpdate();

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Column,com_Columns,com_FaceTree,com_Item,com_Items,com_Items1,com_Items2;
	anytype var_Column,var_Columns,var_FaceTree,var_Item,var_Items,var_Items1,var_Items2;
	;

	super();

	extreecube1.BeginUpdate();
	var_FaceTree = extreecube1.FrontFace().CreateTree(); com_FaceTree = var_FaceTree;
		com_FaceTree.ItemPadding(10);
		com_FaceTree.LinesAtRoot(2/*exGroupLines*/);
		com_FaceTree.DrawGridLines(-2/*exRowLines*/);
		var_Columns = COM::createFromObject(com_FaceTree.Columns()); com_Columns = var_Columns;
		var_Column = COM::createFromObject(com_Columns).Add("Default"); com_Column = var_Column;
		com_Column.Alignment(0/*LeftAlignment*/);
		var_Columns = COM::createFromObject(com_FaceTree.Columns()); com_Columns = var_Columns;
		var_Column = COM::createFromObject(com_Columns).Add("Pos"); com_Column = var_Column;
			com_Column.Position(0);
			com_Column.Alignment(0/*LeftAlignment*/);
			com_Column.FormatColumn("1 rpos ``");
			com_Column.Width(24);
		var_Items = com_FaceTree.Items(); com_Items = var_Items;
			var_Item = COM::createFromObject(com_Items.Add("Root 1")); com_Item = var_Item;
			var_Items1 = com_Item.Items(); com_Items1 = var_Items1;
				com_Items1.Add("Child 1");
				com_Items1.Add("Child 2");
				com_Items1.Add("Child 3");
			var_Item = COM::createFromObject(com_Items.Add("Root 2")); com_Item = var_Item;
			var_Items2 = com_Item.Items(); com_Items2 = var_Items2;
				com_Items2.Add("Child 1");
				com_Items2.Add("Child 2");
				com_Items2.Add("Child 3");
			com_Items.ExpandAll();
	extreecube1.EndUpdate();
}

Delphi 8 (.NET only)

with AxTreeCube1 do
begin
	BeginUpdate();
	with FrontFace.CreateTree() do
	begin
		ItemPadding := 10;
		LinesAtRoot := EXTREECUBELib.LinesAtRootEnum.exGroupLines;
		DrawGridLines := EXTREECUBELib.GridLinesEnum.exRowLines;
		Columns.Add('Default').Alignment := EXTREECUBELib.AlignmentEnum.LeftAlignment;
		with Columns.Add('Pos') do
		begin
			Position := 0;
			Alignment := EXTREECUBELib.AlignmentEnum.LeftAlignment;
			FormatColumn := '1 rpos ``';
			Width := 24;
		end;
		with Items do
		begin
			with Add('Root 1').Items do
			begin
				Add('Child 1');
				Add('Child 2');
				Add('Child 3');
			end;
			with Add('Root 2').Items do
			begin
				Add('Child 1');
				Add('Child 2');
				Add('Child 3');
			end;
			ExpandAll();
		end;
	end;
	EndUpdate();
end

Delphi (standard)

with TreeCube1 do
begin
	BeginUpdate();
	with FrontFace.CreateTree() do
	begin
		ItemPadding := 10;
		LinesAtRoot := EXTREECUBELib_TLB.exGroupLines;
		DrawGridLines := EXTREECUBELib_TLB.exRowLines;
		Columns.Add('Default').Alignment := EXTREECUBELib_TLB.LeftAlignment;
		with Columns.Add('Pos') do
		begin
			Position := 0;
			Alignment := EXTREECUBELib_TLB.LeftAlignment;
			FormatColumn := '1 rpos ``';
			Width := 24;
		end;
		with Items do
		begin
			with Add('Root 1').Items do
			begin
				Add('Child 1');
				Add('Child 2');
				Add('Child 3');
			end;
			with Add('Root 2').Items do
			begin
				Add('Child 1');
				Add('Child 2');
				Add('Child 3');
			end;
			ExpandAll();
		end;
	end;
	EndUpdate();
end

VFP

with thisform.TreeCube1
	.BeginUpdate
	with .FrontFace.CreateTree
		.ItemPadding = 10
		.LinesAtRoot = 2
		.DrawGridLines = -2
		.Columns.Add("Default").Alignment = 0
		with .Columns.Add("Pos")
			.Position = 0
			.Alignment = 0
			.FormatColumn = "1 rpos ``"
			.Width = 24
		endwith
		with .Items
			with .Add("Root 1").Items
				.Add("Child 1")
				.Add("Child 2")
				.Add("Child 3")
			endwith
			with .Add("Root 2").Items
				.Add("Child 1")
				.Add("Child 2")
				.Add("Child 3")
			endwith
			.ExpandAll
		endwith
	endwith
	.EndUpdate
endwith

dBASE Plus

local oTreeCube,var_Column,var_Column1,var_FaceTree,var_Items,var_Items1,var_Items2

oTreeCube = form.EXTREECUBEACTIVEXCONTROL1.nativeObject
oTreeCube.BeginUpdate()
var_FaceTree = oTreeCube.FrontFace.CreateTree()
	var_FaceTree.ItemPadding = 10
	var_FaceTree.LinesAtRoot = 2
	var_FaceTree.DrawGridLines = -2
	// var_FaceTree.Columns.Add("Default").Alignment = 0
	var_Column = var_FaceTree.Columns.Add("Default")
	with (oTreeCube)
		TemplateDef = [dim var_Column]
		TemplateDef = var_Column
		Template = [var_Column.Alignment = 0]
	endwith
	var_Column1 = var_FaceTree.Columns.Add("Pos")
		var_Column1.Position = 0
		var_Column1.Alignment = 0
		var_Column1.FormatColumn = "1 rpos ``"
		var_Column1.Width = 24
	var_Items = var_FaceTree.Items
		var_Items1 = var_Items.Add("Root 1").Items
			var_Items1.Add("Child 1")
			var_Items1.Add("Child 2")
			var_Items1.Add("Child 3")
		var_Items2 = var_Items.Add("Root 2").Items
			var_Items2.Add("Child 1")
			var_Items2.Add("Child 2")
			var_Items2.Add("Child 3")
		var_Items.ExpandAll()
oTreeCube.EndUpdate()

XBasic (Alpha Five)

Dim oTreeCube as P
Dim var_Column as local
Dim var_Column1 as P
Dim var_FaceTree as P
Dim var_Items as P
Dim var_Items1 as P
Dim var_Items2 as P

oTreeCube = topparent:CONTROL_ACTIVEX1.activex
oTreeCube.BeginUpdate()
var_FaceTree = oTreeCube.FrontFace.CreateTree()
	var_FaceTree.ItemPadding = 10
	var_FaceTree.LinesAtRoot = 2
	var_FaceTree.DrawGridLines = -2
	' var_FaceTree.Columns.Add("Default").Alignment = 0
	var_Column = var_FaceTree.Columns.Add("Default")
	oTreeCube.TemplateDef = "dim var_Column"
	oTreeCube.TemplateDef = var_Column
	oTreeCube.Template = "var_Column.Alignment = 0"

	var_Column1 = var_FaceTree.Columns.Add("Pos")
		var_Column1.Position = 0
		var_Column1.Alignment = 0
		var_Column1.FormatColumn = "1 rpos ``"
		var_Column1.Width = 24
	var_Items = var_FaceTree.Items
		var_Items1 = var_Items.Add("Root 1").Items
			var_Items1.Add("Child 1")
			var_Items1.Add("Child 2")
			var_Items1.Add("Child 3")
		var_Items2 = var_Items.Add("Root 2").Items
			var_Items2.Add("Child 1")
			var_Items2.Add("Child 2")
			var_Items2.Add("Child 3")
		var_Items.ExpandAll()
oTreeCube.EndUpdate()

Visual Objects

local var_Column as IColumn
local var_FaceTree as IFaceTree
local var_Items,var_Items1,var_Items2 as IItems

oDCOCX_Exontrol1:BeginUpdate()
var_FaceTree := oDCOCX_Exontrol1:FrontFace:CreateTree()
	var_FaceTree:ItemPadding := 10
	var_FaceTree:LinesAtRoot := exGroupLines
	var_FaceTree:DrawGridLines := exRowLines
	var_FaceTree:Columns:Add("Default"):Alignment := LeftAlignment
	var_Column := var_FaceTree:Columns:Add("Pos")
		var_Column:Position := 0
		var_Column:Alignment := LeftAlignment
		var_Column:FormatColumn := "1 rpos ``"
		var_Column:Width := 24
	var_Items := var_FaceTree:Items
		var_Items1 := var_Items:Add("Root 1"):Items
			var_Items1:Add("Child 1")
			var_Items1:Add("Child 2")
			var_Items1:Add("Child 3")
		var_Items2 := var_Items:Add("Root 2"):Items
			var_Items2:Add("Child 1")
			var_Items2:Add("Child 2")
			var_Items2:Add("Child 3")
		var_Items:ExpandAll()
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

OleObject oTreeCube,var_Column,var_FaceTree,var_Items,var_Items1,var_Items2

oTreeCube = ole_1.Object
oTreeCube.BeginUpdate()
var_FaceTree = oTreeCube.FrontFace.CreateTree()
	var_FaceTree.ItemPadding = 10
	var_FaceTree.LinesAtRoot = 2
	var_FaceTree.DrawGridLines = -2
	var_FaceTree.Columns.Add("Default").Alignment = 0
	var_Column = var_FaceTree.Columns.Add("Pos")
		var_Column.Position = 0
		var_Column.Alignment = 0
		var_Column.FormatColumn = "1 rpos ``"
		var_Column.Width = 24
	var_Items = var_FaceTree.Items
		var_Items1 = var_Items.Add("Root 1").Items
			var_Items1.Add("Child 1")
			var_Items1.Add("Child 2")
			var_Items1.Add("Child 3")
		var_Items2 = var_Items.Add("Root 2").Items
			var_Items2.Add("Child 1")
			var_Items2.Add("Child 2")
			var_Items2.Add("Child 3")
		var_Items.ExpandAll()
oTreeCube.EndUpdate()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Variant voFace
	Get ComFrontFace to voFace
	Handle hoFace
	Get Create (RefClass(cComFace)) to hoFace
	Set pvComObject of hoFace to voFace
		Variant voFaceTree
		Get ComCreateTree of hoFace to voFaceTree
		Handle hoFaceTree
		Get Create (RefClass(cComFaceTree)) to hoFaceTree
		Set pvComObject of hoFaceTree to voFaceTree
			Set ComItemPadding of hoFaceTree to 10
			Set ComLinesAtRoot of hoFaceTree to OLEexGroupLines
			Set ComDrawGridLines of hoFaceTree to OLEexRowLines
			Variant voColumns
			Get ComColumns of hoFaceTree to voColumns
			Handle hoColumns
			Get Create (RefClass(cComColumns)) to hoColumns
			Set pvComObject of hoColumns to voColumns
				Variant voColumn
				Get ComAdd of hoColumns "Default" to voColumn
				Handle hoColumn
				Get Create (RefClass(cComColumn)) to hoColumn
				Set pvComObject of hoColumn to voColumn
					Set ComAlignment of hoColumn to OLELeftAlignment
				Send Destroy to hoColumn
			Send Destroy to hoColumns
			Variant voColumns1
			Get ComColumns of hoFaceTree to voColumns1
			Handle hoColumns1
			Get Create (RefClass(cComColumns)) to hoColumns1
			Set pvComObject of hoColumns1 to voColumns1
				Variant voColumn1
				Get ComAdd of hoColumns1 "Pos" to voColumn1
				Handle hoColumn1
				Get Create (RefClass(cComColumn)) to hoColumn1
				Set pvComObject of hoColumn1 to voColumn1
					Set ComPosition of hoColumn1 to 0
					Set ComAlignment of hoColumn1 to OLELeftAlignment
					Set ComFormatColumn of hoColumn1 to "1 rpos ``"
					Set ComWidth of hoColumn1 to 24
				Send Destroy to hoColumn1
			Send Destroy to hoColumns1
			Variant voItems
			Get ComItems of hoFaceTree to voItems
			Handle hoItems
			Get Create (RefClass(cComItems)) to hoItems
			Set pvComObject of hoItems to voItems
				Variant voItem
				Get ComAdd of hoItems "Root 1" to voItem
				Handle hoItem
				Get Create (RefClass(cComItem)) to hoItem
				Set pvComObject of hoItem to voItem
					Variant voItems1
					Get ComItems of hoItem to voItems1
					Handle hoItems1
					Get Create (RefClass(cComItems)) to hoItems1
					Set pvComObject of hoItems1 to voItems1
						Get ComAdd of hoItems1 "Child 1" to Nothing
						Get ComAdd of hoItems1 "Child 2" to Nothing
						Get ComAdd of hoItems1 "Child 3" to Nothing
					Send Destroy to hoItems1
				Send Destroy to hoItem
				Variant voItem1
				Get ComAdd of hoItems "Root 2" to voItem1
				Handle hoItem1
				Get Create (RefClass(cComItem)) to hoItem1
				Set pvComObject of hoItem1 to voItem1
					Variant voItems2
					Get ComItems of hoItem1 to voItems2
					Handle hoItems2
					Get Create (RefClass(cComItems)) to hoItems2
					Set pvComObject of hoItems2 to voItems2
						Get ComAdd of hoItems2 "Child 1" to Nothing
						Get ComAdd of hoItems2 "Child 2" to Nothing
						Get ComAdd of hoItems2 "Child 3" to Nothing
					Send Destroy to hoItems2
				Send Destroy to hoItem1
				Send ComExpandAll of hoItems
			Send Destroy to hoItems
		Send Destroy to hoFaceTree
	Send Destroy to hoFace
	Send ComEndUpdate
End_Procedure

XBase++

#include "AppEvent.ch"
#include "ActiveX.ch"

PROCEDURE Main
 	LOCAL oForm
	LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL
	LOCAL oColumn
	LOCAL oFaceTree
	LOCAL oItems,oItems1,oItems2
	LOCAL oTreeCube

	oForm := XbpDialog():new( AppDesktop() )
	oForm:drawingArea:clipChildren := .T.
	oForm:create( ,,{100,100}, {640,480},, .F. )
	oForm:close  := {|| PostAppEvent( xbeP_Quit )}

	oTreeCube := XbpActiveXControl():new( oForm:drawingArea )
	oTreeCube:CLSID  := "Exontrol.TreeCube.1" /*{13A5B44B-DBB7-42F2-AE2B-943A6CF6C8B9}*/
	oTreeCube:create(,, {10,60},{610,370} )

		oTreeCube:BeginUpdate()
		oFaceTree := oTreeCube:FrontFace():CreateTree()
			oFaceTree:ItemPadding := 10
			oFaceTree:LinesAtRoot := 2/*exGroupLines*/
			oFaceTree:DrawGridLines := -2/*exRowLines*/
			oFaceTree:Columns():Add("Default"):Alignment := 0/*LeftAlignment*/
			oColumn := oFaceTree:Columns():Add("Pos")
				oColumn:Position := 0
				oColumn:Alignment := 0/*LeftAlignment*/
				oColumn:FormatColumn := "1 rpos ``"
				oColumn:Width := 24
			oItems := oFaceTree:Items()
				oItems1 := oItems:Add("Root 1"):Items()
					oItems1:Add("Child 1")
					oItems1:Add("Child 2")
					oItems1:Add("Child 3")
				oItems2 := oItems:Add("Root 2"):Items()
					oItems2:Add("Child 1")
					oItems2:Add("Child 2")
					oItems2:Add("Child 3")
				oItems:ExpandAll()
		oTreeCube:EndUpdate()

	oForm:Show()
	DO WHILE nEvent != xbeP_Quit
		nEvent := AppEvent( @mp1, @mp2, @oXbp )
		oXbp:handleEvent( nEvent, mp1, mp2 )
	ENDDO 
RETURN