exmlgrid - sample code

Does your control support transparent selection?

VBA (MS Access, Excell...)

With XMLGrid1
	.BeginUpdate 
	.SelBackMode = 1
	.SelBackColorChild = .SelBackColor
	With .Nodes.Add("Parent")
		With .Nodes
			.Add("Child <b>1").Value = 100
			With .Add("Child <b>2")
				With .Nodes
					.Add("Sub Child <b>2.1").Value = 101
					With .Add("Sub Child <b>2.2")
						With .Nodes
							.Add("Sub Child <b>2.1.1").Value = 101
							.Add("Sub Child <b>2.2.2").Value = 102
						End With
						.Expanded = True
					End With
				End With
				.Expanded = True
			End With
		End With
		.Selected = True
		.Expanded = True
	End With
	.LevelWidth(0) = 64
	.LevelWidth(1) = 96
	.LevelWidth(2) = 96
	.EndUpdate 
End With

VB6

With XMLGrid1
	.BeginUpdate 
	.SelBackMode = exTransparent
	.SelBackColorChild = .SelBackColor
	With .Nodes.Add("Parent")
		With .Nodes
			.Add("Child <b>1").Value = 100
			With .Add("Child <b>2")
				With .Nodes
					.Add("Sub Child <b>2.1").Value = 101
					With .Add("Sub Child <b>2.2")
						With .Nodes
							.Add("Sub Child <b>2.1.1").Value = 101
							.Add("Sub Child <b>2.2.2").Value = 102
						End With
						.Expanded = True
					End With
				End With
				.Expanded = True
			End With
		End With
		.Selected = True
		.Expanded = True
	End With
	.LevelWidth(0) = 64
	.LevelWidth(1) = 96
	.LevelWidth(2) = 96
	.EndUpdate 
End With

VB.NET

With Exxmlgrid1
	.BeginUpdate()
	.SelBackMode = exontrol.EXMLGRIDLib.BackModeEnum.exTransparent
	.SelBackColorChild = .SelBackColor
	With .Nodes.Add("Parent")
		With .Nodes
			.Add("Child <b>1").Value = 100
			With .Add("Child <b>2")
				With .Nodes
					.Add("Sub Child <b>2.1").Value = 101
					With .Add("Sub Child <b>2.2")
						With .Nodes
							.Add("Sub Child <b>2.1.1").Value = 101
							.Add("Sub Child <b>2.2.2").Value = 102
						End With
						.Expanded = True
					End With
				End With
				.Expanded = True
			End With
		End With
		.Selected = True
		.Expanded = True
	End With
	.set_LevelWidth(0,64)
	.set_LevelWidth(1,96)
	.set_LevelWidth(2,96)
	.EndUpdate()
End With

VB.NET for /COM

With AxXMLGrid1
	.BeginUpdate()
	.SelBackMode = EXMLGRIDLib.BackModeEnum.exTransparent
	.SelBackColorChild = .SelBackColor
	With .Nodes.Add("Parent")
		With .Nodes
			.Add("Child <b>1").Value = 100
			With .Add("Child <b>2")
				With .Nodes
					.Add("Sub Child <b>2.1").Value = 101
					With .Add("Sub Child <b>2.2")
						With .Nodes
							.Add("Sub Child <b>2.1.1").Value = 101
							.Add("Sub Child <b>2.2.2").Value = 102
						End With
						.Expanded = True
					End With
				End With
				.Expanded = True
			End With
		End With
		.Selected = True
		.Expanded = True
	End With
	.set_LevelWidth(0,64)
	.set_LevelWidth(1,96)
	.set_LevelWidth(2,96)
	.EndUpdate()
End With

C++

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

	#import <EXMLGrid.dll>
	using namespace EXMLGRIDLib;
*/
EXMLGRIDLib::IXMLGridPtr spXMLGrid1 = GetDlgItem(IDC_XMLGRID1)->GetControlUnknown();
spXMLGrid1->BeginUpdate();
spXMLGrid1->PutSelBackMode(EXMLGRIDLib::exTransparent);
spXMLGrid1->PutSelBackColorChild(spXMLGrid1->GetSelBackColor());
EXMLGRIDLib::INodePtr var_Node = spXMLGrid1->GetNodes()->Add(L"Parent",vtMissing,vtMissing);
	EXMLGRIDLib::INodesPtr var_Nodes = var_Node->GetNodes();
		var_Nodes->Add(L"Child <b>1",vtMissing,vtMissing)->PutValue(long(100));
		EXMLGRIDLib::INodePtr var_Node1 = var_Nodes->Add(L"Child <b>2",vtMissing,vtMissing);
			EXMLGRIDLib::INodesPtr var_Nodes1 = var_Node1->GetNodes();
				var_Nodes1->Add(L"Sub Child <b>2.1",vtMissing,vtMissing)->PutValue(long(101));
				EXMLGRIDLib::INodePtr var_Node2 = var_Nodes1->Add(L"Sub Child <b>2.2",vtMissing,vtMissing);
					EXMLGRIDLib::INodesPtr var_Nodes2 = var_Node2->GetNodes();
						var_Nodes2->Add(L"Sub Child <b>2.1.1",vtMissing,vtMissing)->PutValue(long(101));
						var_Nodes2->Add(L"Sub Child <b>2.2.2",vtMissing,vtMissing)->PutValue(long(102));
					var_Node2->PutExpanded(VARIANT_TRUE);
			var_Node1->PutExpanded(VARIANT_TRUE);
	var_Node->PutSelected(VARIANT_TRUE);
	var_Node->PutExpanded(VARIANT_TRUE);
spXMLGrid1->PutLevelWidth(0,64);
spXMLGrid1->PutLevelWidth(1,96);
spXMLGrid1->PutLevelWidth(2,96);
spXMLGrid1->EndUpdate();

C++ Builder

XMLGrid1->BeginUpdate();
XMLGrid1->SelBackMode = Exmlgridlib_tlb::BackModeEnum::exTransparent;
XMLGrid1->SelBackColorChild = XMLGrid1->SelBackColor;
Exmlgridlib_tlb::INodePtr var_Node = XMLGrid1->Nodes->Add(L"Parent",TNoParam(),TNoParam());
	Exmlgridlib_tlb::INodesPtr var_Nodes = var_Node->Nodes;
		var_Nodes->Add(L"Child <b>1",TNoParam(),TNoParam())->set_Value(TVariant(100));
		Exmlgridlib_tlb::INodePtr var_Node1 = var_Nodes->Add(L"Child <b>2",TNoParam(),TNoParam());
			Exmlgridlib_tlb::INodesPtr var_Nodes1 = var_Node1->Nodes;
				var_Nodes1->Add(L"Sub Child <b>2.1",TNoParam(),TNoParam())->set_Value(TVariant(101));
				Exmlgridlib_tlb::INodePtr var_Node2 = var_Nodes1->Add(L"Sub Child <b>2.2",TNoParam(),TNoParam());
					Exmlgridlib_tlb::INodesPtr var_Nodes2 = var_Node2->Nodes;
						var_Nodes2->Add(L"Sub Child <b>2.1.1",TNoParam(),TNoParam())->set_Value(TVariant(101));
						var_Nodes2->Add(L"Sub Child <b>2.2.2",TNoParam(),TNoParam())->set_Value(TVariant(102));
					var_Node2->Expanded = true;
			var_Node1->Expanded = true;
	var_Node->Selected = true;
	var_Node->Expanded = true;
XMLGrid1->LevelWidth[0] = 64;
XMLGrid1->LevelWidth[1] = 96;
XMLGrid1->LevelWidth[2] = 96;
XMLGrid1->EndUpdate();

C#

exxmlgrid1.BeginUpdate();
exxmlgrid1.SelBackMode = exontrol.EXMLGRIDLib.BackModeEnum.exTransparent;
exxmlgrid1.SelBackColorChild = exxmlgrid1.SelBackColor;
exontrol.EXMLGRIDLib.Node var_Node = exxmlgrid1.Nodes.Add("Parent",null,null);
	exontrol.EXMLGRIDLib.Nodes var_Nodes = var_Node.Nodes;
		var_Nodes.Add("Child <b>1",null,null).Value = 100;
		exontrol.EXMLGRIDLib.Node var_Node1 = var_Nodes.Add("Child <b>2",null,null);
			exontrol.EXMLGRIDLib.Nodes var_Nodes1 = var_Node1.Nodes;
				var_Nodes1.Add("Sub Child <b>2.1",null,null).Value = 101;
				exontrol.EXMLGRIDLib.Node var_Node2 = var_Nodes1.Add("Sub Child <b>2.2",null,null);
					exontrol.EXMLGRIDLib.Nodes var_Nodes2 = var_Node2.Nodes;
						var_Nodes2.Add("Sub Child <b>2.1.1",null,null).Value = 101;
						var_Nodes2.Add("Sub Child <b>2.2.2",null,null).Value = 102;
					var_Node2.Expanded = true;
			var_Node1.Expanded = true;
	var_Node.Selected = true;
	var_Node.Expanded = true;
exxmlgrid1.set_LevelWidth(0,64);
exxmlgrid1.set_LevelWidth(1,96);
exxmlgrid1.set_LevelWidth(2,96);
exxmlgrid1.EndUpdate();

JScript/JavaScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:AC7F976E-48C3-4B0B-B952-45D92DFE7F3E" id="XMLGrid1"></OBJECT>

<SCRIPT LANGUAGE="JScript">
function Init()
{
	XMLGrid1.BeginUpdate();
	XMLGrid1.SelBackMode = 1;
	XMLGrid1.SelBackColorChild = XMLGrid1.SelBackColor;
	var var_Node = XMLGrid1.Nodes.Add("Parent",null,null);
		var var_Nodes = var_Node.Nodes;
			var_Nodes.Add("Child <b>1",null,null).Value = 100;
			var var_Node1 = var_Nodes.Add("Child <b>2",null,null);
				var var_Nodes1 = var_Node1.Nodes;
					var_Nodes1.Add("Sub Child <b>2.1",null,null).Value = 101;
					var var_Node2 = var_Nodes1.Add("Sub Child <b>2.2",null,null);
						var var_Nodes2 = var_Node2.Nodes;
							var_Nodes2.Add("Sub Child <b>2.1.1",null,null).Value = 101;
							var_Nodes2.Add("Sub Child <b>2.2.2",null,null).Value = 102;
						var_Node2.Expanded = true;
				var_Node1.Expanded = true;
		var_Node.Selected = true;
		var_Node.Expanded = true;
	XMLGrid1.LevelWidth(0) = 64;
	XMLGrid1.LevelWidth(1) = 96;
	XMLGrid1.LevelWidth(2) = 96;
	XMLGrid1.EndUpdate();
}
</SCRIPT>
</BODY>

VBScript

<BODY onload="Init()">
<OBJECT CLASSID="clsid:AC7F976E-48C3-4B0B-B952-45D92DFE7F3E" id="XMLGrid1"></OBJECT>

<SCRIPT LANGUAGE="VBScript">
Function Init()
	With XMLGrid1
		.BeginUpdate 
		.SelBackMode = 1
		.SelBackColorChild = .SelBackColor
		With .Nodes.Add("Parent")
			With .Nodes
				.Add("Child <b>1").Value = 100
				With .Add("Child <b>2")
					With .Nodes
						.Add("Sub Child <b>2.1").Value = 101
						With .Add("Sub Child <b>2.2")
							With .Nodes
								.Add("Sub Child <b>2.1.1").Value = 101
								.Add("Sub Child <b>2.2.2").Value = 102
							End With
							.Expanded = True
						End With
					End With
					.Expanded = True
				End With
			End With
			.Selected = True
			.Expanded = True
		End With
		.LevelWidth(0) = 64
		.LevelWidth(1) = 96
		.LevelWidth(2) = 96
		.EndUpdate 
	End With
End Function
</SCRIPT>
</BODY>

C# for /COM

axXMLGrid1.BeginUpdate();
axXMLGrid1.SelBackMode = EXMLGRIDLib.BackModeEnum.exTransparent;
axXMLGrid1.SelBackColorChild = axXMLGrid1.SelBackColor;
EXMLGRIDLib.Node var_Node = axXMLGrid1.Nodes.Add("Parent",null,null);
	EXMLGRIDLib.Nodes var_Nodes = var_Node.Nodes;
		var_Nodes.Add("Child <b>1",null,null).Value = 100;
		EXMLGRIDLib.Node var_Node1 = var_Nodes.Add("Child <b>2",null,null);
			EXMLGRIDLib.Nodes var_Nodes1 = var_Node1.Nodes;
				var_Nodes1.Add("Sub Child <b>2.1",null,null).Value = 101;
				EXMLGRIDLib.Node var_Node2 = var_Nodes1.Add("Sub Child <b>2.2",null,null);
					EXMLGRIDLib.Nodes var_Nodes2 = var_Node2.Nodes;
						var_Nodes2.Add("Sub Child <b>2.1.1",null,null).Value = 101;
						var_Nodes2.Add("Sub Child <b>2.2.2",null,null).Value = 102;
					var_Node2.Expanded = true;
			var_Node1.Expanded = true;
	var_Node.Selected = true;
	var_Node.Expanded = true;
axXMLGrid1.set_LevelWidth(0,64);
axXMLGrid1.set_LevelWidth(1,96);
axXMLGrid1.set_LevelWidth(2,96);
axXMLGrid1.EndUpdate();

X++ (Dynamics Ax 2009)

public void init()
{
	COM com_Node,com_Node1,com_Node2,com_Node3,com_Nodes,com_Nodes1,com_Nodes2;
	anytype var_Node,var_Node1,var_Node2,var_Node3,var_Nodes,var_Nodes1,var_Nodes2;
	;

	super();

	exxmlgrid1.BeginUpdate();
	exxmlgrid1.SelBackMode(1/*exTransparent*/);
	exxmlgrid1.SelBackColorChild(exxmlgrid1.SelBackColor());
	var_Node = COM::createFromObject(exxmlgrid1.Nodes()).Add("Parent"); com_Node = var_Node;
		var_Nodes = com_Node.Nodes(); com_Nodes = var_Nodes;
			var_Node1 = COM::createFromObject(com_Nodes.Add("Child <b>1")); com_Node1 = var_Node1;
			com_Node1.Value(COMVariant::createFromInt(100));
			var_Node1 = com_Nodes.Add("Child <b>2"); com_Node1 = var_Node1;
				var_Nodes1 = com_Node1.Nodes(); com_Nodes1 = var_Nodes1;
					var_Node2 = COM::createFromObject(com_Nodes1.Add("Sub Child <b>2.1")); com_Node2 = var_Node2;
					com_Node2.Value(COMVariant::createFromInt(101));
					var_Node2 = com_Nodes1.Add("Sub Child <b>2.2"); com_Node2 = var_Node2;
						var_Nodes2 = com_Node2.Nodes(); com_Nodes2 = var_Nodes2;
							var_Node3 = COM::createFromObject(com_Nodes2.Add("Sub Child <b>2.1.1")); com_Node3 = var_Node3;
							com_Node3.Value(COMVariant::createFromInt(101));
							var_Node3 = COM::createFromObject(com_Nodes2.Add("Sub Child <b>2.2.2")); com_Node3 = var_Node3;
							com_Node3.Value(COMVariant::createFromInt(102));
						com_Node2.Expanded(true);
				com_Node1.Expanded(true);
		com_Node.Selected(true);
		com_Node.Expanded(true);
	exxmlgrid1.LevelWidth(0,64);
	exxmlgrid1.LevelWidth(1,96);
	exxmlgrid1.LevelWidth(2,96);
	exxmlgrid1.EndUpdate();
}

Delphi 8 (.NET only)

with AxXMLGrid1 do
begin
	BeginUpdate();
	SelBackMode := EXMLGRIDLib.BackModeEnum.exTransparent;
	SelBackColorChild := SelBackColor;
	with Nodes.Add('Parent',Nil,Nil) do
	begin
		with Nodes do
		begin
			Add('Child <b>1',Nil,Nil).Value := TObject(100);
			with Add('Child <b>2',Nil,Nil) do
			begin
				with Nodes do
				begin
					Add('Sub Child <b>2.1',Nil,Nil).Value := TObject(101);
					with Add('Sub Child <b>2.2',Nil,Nil) do
					begin
						with Nodes do
						begin
							Add('Sub Child <b>2.1.1',Nil,Nil).Value := TObject(101);
							Add('Sub Child <b>2.2.2',Nil,Nil).Value := TObject(102);
						end;
						Expanded := True;
					end;
				end;
				Expanded := True;
			end;
		end;
		Selected := True;
		Expanded := True;
	end;
	set_LevelWidth(0,64);
	set_LevelWidth(1,96);
	set_LevelWidth(2,96);
	EndUpdate();
end

Delphi (standard)

with XMLGrid1 do
begin
	BeginUpdate();
	SelBackMode := EXMLGRIDLib_TLB.exTransparent;
	SelBackColorChild := SelBackColor;
	with Nodes.Add('Parent',Null,Null) do
	begin
		with Nodes do
		begin
			Add('Child <b>1',Null,Null).Value := OleVariant(100);
			with Add('Child <b>2',Null,Null) do
			begin
				with Nodes do
				begin
					Add('Sub Child <b>2.1',Null,Null).Value := OleVariant(101);
					with Add('Sub Child <b>2.2',Null,Null) do
					begin
						with Nodes do
						begin
							Add('Sub Child <b>2.1.1',Null,Null).Value := OleVariant(101);
							Add('Sub Child <b>2.2.2',Null,Null).Value := OleVariant(102);
						end;
						Expanded := True;
					end;
				end;
				Expanded := True;
			end;
		end;
		Selected := True;
		Expanded := True;
	end;
	LevelWidth[0] := 64;
	LevelWidth[1] := 96;
	LevelWidth[2] := 96;
	EndUpdate();
end

VFP

with thisform.XMLGrid1
	.BeginUpdate
	.SelBackMode = 1
	.SelBackColorChild = .SelBackColor
	with .Nodes.Add("Parent")
		with .Nodes
			.Add("Child <b>1").Value = 100
			with .Add("Child <b>2")
				with .Nodes
					.Add("Sub Child <b>2.1").Value = 101
					with .Add("Sub Child <b>2.2")
						with .Nodes
							.Add("Sub Child <b>2.1.1").Value = 101
							.Add("Sub Child <b>2.2.2").Value = 102
						endwith
						.Expanded = .T.
					endwith
				endwith
				.Expanded = .T.
			endwith
		endwith
		.Selected = .T.
		.Expanded = .T.
	endwith
	.Object.LevelWidth(0) = 64
	.Object.LevelWidth(1) = 96
	.Object.LevelWidth(2) = 96
	.EndUpdate
endwith

dBASE Plus

local oXMLGrid,var_Node,var_Node1,var_Node2,var_Node3,var_Node4,var_Node5,var_Node6,var_Nodes,var_Nodes1,var_Nodes2

oXMLGrid = form.EXMLGRIDACTIVEXCONTROL1.nativeObject
oXMLGrid.BeginUpdate()
oXMLGrid.SelBackMode = 1
oXMLGrid.SelBackColorChild = oXMLGrid.SelBackColor
var_Node = oXMLGrid.Nodes.Add("Parent")
	var_Nodes = var_Node.Nodes
		// var_Nodes.Add("Child <b>1").Value = 100
		var_Node1 = var_Nodes.Add("Child <b>1")
		with (oXMLGrid)
			TemplateDef = [dim var_Node1]
			TemplateDef = var_Node1
			Template = [var_Node1.Value = 100]
		endwith
		var_Node2 = var_Nodes.Add("Child <b>2")
			var_Nodes1 = var_Node2.Nodes
				// var_Nodes1.Add("Sub Child <b>2.1").Value = 101
				var_Node3 = var_Nodes1.Add("Sub Child <b>2.1")
				with (oXMLGrid)
					TemplateDef = [dim var_Node3]
					TemplateDef = var_Node3
					Template = [var_Node3.Value = 101]
				endwith
				var_Node4 = var_Nodes1.Add("Sub Child <b>2.2")
					var_Nodes2 = var_Node4.Nodes
						// var_Nodes2.Add("Sub Child <b>2.1.1").Value = 101
						var_Node5 = var_Nodes2.Add("Sub Child <b>2.1.1")
						with (oXMLGrid)
							TemplateDef = [dim var_Node5]
							TemplateDef = var_Node5
							Template = [var_Node5.Value = 101]
						endwith
						// var_Nodes2.Add("Sub Child <b>2.2.2").Value = 102
						var_Node6 = var_Nodes2.Add("Sub Child <b>2.2.2")
						with (oXMLGrid)
							TemplateDef = [dim var_Node6]
							TemplateDef = var_Node6
							Template = [var_Node6.Value = 102]
						endwith
					var_Node4.Expanded = true
			var_Node2.Expanded = true
	var_Node.Selected = true
	var_Node.Expanded = true
oXMLGrid.Template = [LevelWidth(0) = 64] // oXMLGrid.LevelWidth(0) = 64
oXMLGrid.Template = [LevelWidth(1) = 96] // oXMLGrid.LevelWidth(1) = 96
oXMLGrid.Template = [LevelWidth(2) = 96] // oXMLGrid.LevelWidth(2) = 96
oXMLGrid.EndUpdate()

XBasic (Alpha Five)

Dim oXMLGrid as P
Dim var_Node as P
Dim var_Node1 as local
Dim var_Node2 as P
Dim var_Node3 as local
Dim var_Node4 as P
Dim var_Node5 as local
Dim var_Node6 as local
Dim var_Nodes as P
Dim var_Nodes1 as P
Dim var_Nodes2 as P

oXMLGrid = topparent:CONTROL_ACTIVEX1.activex
oXMLGrid.BeginUpdate()
oXMLGrid.SelBackMode = 1
oXMLGrid.SelBackColorChild = oXMLGrid.SelBackColor
var_Node = oXMLGrid.Nodes.Add("Parent")
	var_Nodes = var_Node.Nodes
		' var_Nodes.Add("Child <b>1").Value = 100
		var_Node1 = var_Nodes.Add("Child <b>1")
		oXMLGrid.TemplateDef = "dim var_Node1"
		oXMLGrid.TemplateDef = var_Node1
		oXMLGrid.Template = "var_Node1.Value = 100"

		var_Node2 = var_Nodes.Add("Child <b>2")
			var_Nodes1 = var_Node2.Nodes
				' var_Nodes1.Add("Sub Child <b>2.1").Value = 101
				var_Node3 = var_Nodes1.Add("Sub Child <b>2.1")
				oXMLGrid.TemplateDef = "dim var_Node3"
				oXMLGrid.TemplateDef = var_Node3
				oXMLGrid.Template = "var_Node3.Value = 101"

				var_Node4 = var_Nodes1.Add("Sub Child <b>2.2")
					var_Nodes2 = var_Node4.Nodes
						' var_Nodes2.Add("Sub Child <b>2.1.1").Value = 101
						var_Node5 = var_Nodes2.Add("Sub Child <b>2.1.1")
						oXMLGrid.TemplateDef = "dim var_Node5"
						oXMLGrid.TemplateDef = var_Node5
						oXMLGrid.Template = "var_Node5.Value = 101"

						' var_Nodes2.Add("Sub Child <b>2.2.2").Value = 102
						var_Node6 = var_Nodes2.Add("Sub Child <b>2.2.2")
						oXMLGrid.TemplateDef = "dim var_Node6"
						oXMLGrid.TemplateDef = var_Node6
						oXMLGrid.Template = "var_Node6.Value = 102"

					var_Node4.Expanded = .t.
			var_Node2.Expanded = .t.
	var_Node.Selected = .t.
	var_Node.Expanded = .t.
oXMLGrid.Template = "LevelWidth(0) = 64" // oXMLGrid.LevelWidth(0) = 64
oXMLGrid.Template = "LevelWidth(1) = 96" // oXMLGrid.LevelWidth(1) = 96
oXMLGrid.Template = "LevelWidth(2) = 96" // oXMLGrid.LevelWidth(2) = 96
oXMLGrid.EndUpdate()

Visual Objects

local var_Node,var_Node1,var_Node2 as INode
local var_Nodes,var_Nodes1,var_Nodes2 as INodes

oDCOCX_Exontrol1:BeginUpdate()
oDCOCX_Exontrol1:SelBackMode := exTransparent
oDCOCX_Exontrol1:SelBackColorChild := oDCOCX_Exontrol1:SelBackColor
var_Node := oDCOCX_Exontrol1:Nodes:Add("Parent",nil,nil)
	var_Nodes := var_Node:Nodes
		var_Nodes:Add("Child <b>1",nil,nil):Value := 100
		var_Node1 := var_Nodes:Add("Child <b>2",nil,nil)
			var_Nodes1 := var_Node1:Nodes
				var_Nodes1:Add("Sub Child <b>2.1",nil,nil):Value := 101
				var_Node2 := var_Nodes1:Add("Sub Child <b>2.2",nil,nil)
					var_Nodes2 := var_Node2:Nodes
						var_Nodes2:Add("Sub Child <b>2.1.1",nil,nil):Value := 101
						var_Nodes2:Add("Sub Child <b>2.2.2",nil,nil):Value := 102
					var_Node2:Expanded := true
			var_Node1:Expanded := true
	var_Node:Selected := true
	var_Node:Expanded := true
oDCOCX_Exontrol1:[LevelWidth,0] := 64
oDCOCX_Exontrol1:[LevelWidth,1] := 96
oDCOCX_Exontrol1:[LevelWidth,2] := 96
oDCOCX_Exontrol1:EndUpdate()

PowerBuilder

OleObject oXMLGrid,var_Node,var_Node1,var_Node2,var_Nodes,var_Nodes1,var_Nodes2

oXMLGrid = ole_1.Object
oXMLGrid.BeginUpdate()
oXMLGrid.SelBackMode = 1
oXMLGrid.SelBackColorChild = oXMLGrid.SelBackColor
var_Node = oXMLGrid.Nodes.Add("Parent")
	var_Nodes = var_Node.Nodes
		var_Nodes.Add("Child <b>1").Value = 100
		var_Node1 = var_Nodes.Add("Child <b>2")
			var_Nodes1 = var_Node1.Nodes
				var_Nodes1.Add("Sub Child <b>2.1").Value = 101
				var_Node2 = var_Nodes1.Add("Sub Child <b>2.2")
					var_Nodes2 = var_Node2.Nodes
						var_Nodes2.Add("Sub Child <b>2.1.1").Value = 101
						var_Nodes2.Add("Sub Child <b>2.2.2").Value = 102
					var_Node2.Expanded = true
			var_Node1.Expanded = true
	var_Node.Selected = true
	var_Node.Expanded = true
oXMLGrid.LevelWidth(0,64)
oXMLGrid.LevelWidth(1,96)
oXMLGrid.LevelWidth(2,96)
oXMLGrid.EndUpdate()

Visual DataFlex

Procedure OnCreate
	Forward Send OnCreate
	Send ComBeginUpdate
	Set ComSelBackMode to OLEexTransparent
	Set ComSelBackColorChild to (ComSelBackColor(Self))
	Variant voNodes
	Get ComNodes to voNodes
	Handle hoNodes
	Get Create (RefClass(cComNodes)) to hoNodes
	Set pvComObject of hoNodes to voNodes
		Variant voNode
		Get ComAdd of hoNodes "Parent" Nothing Nothing to voNode
		Handle hoNode
		Get Create (RefClass(cComNode)) to hoNode
		Set pvComObject of hoNode to voNode
			Variant voNodes1
			Get ComNodes of hoNode to voNodes1
			Handle hoNodes1
			Get Create (RefClass(cComNodes)) to hoNodes1
			Set pvComObject of hoNodes1 to voNodes1
				Variant voNode1
				Get ComAdd of hoNodes1 "Child <b>1" Nothing Nothing to voNode1
				Handle hoNode1
				Get Create (RefClass(cComNode)) to hoNode1
				Set pvComObject of hoNode1 to voNode1
					Set ComValue of hoNode1 to 100
				Send Destroy to hoNode1
				Variant voNode2
				Get ComAdd of hoNodes1 "Child <b>2" Nothing Nothing to voNode2
				Handle hoNode2
				Get Create (RefClass(cComNode)) to hoNode2
				Set pvComObject of hoNode2 to voNode2
					Variant voNodes2
					Get ComNodes of hoNode2 to voNodes2
					Handle hoNodes2
					Get Create (RefClass(cComNodes)) to hoNodes2
					Set pvComObject of hoNodes2 to voNodes2
						Variant voNode3
						Get ComAdd of hoNodes2 "Sub Child <b>2.1" Nothing Nothing to voNode3
						Handle hoNode3
						Get Create (RefClass(cComNode)) to hoNode3
						Set pvComObject of hoNode3 to voNode3
							Set ComValue of hoNode3 to 101
						Send Destroy to hoNode3
						Variant voNode4
						Get ComAdd of hoNodes2 "Sub Child <b>2.2" Nothing Nothing to voNode4
						Handle hoNode4
						Get Create (RefClass(cComNode)) to hoNode4
						Set pvComObject of hoNode4 to voNode4
							Variant voNodes3
							Get ComNodes of hoNode4 to voNodes3
							Handle hoNodes3
							Get Create (RefClass(cComNodes)) to hoNodes3
							Set pvComObject of hoNodes3 to voNodes3
								Variant voNode5
								Get ComAdd of hoNodes3 "Sub Child <b>2.1.1" Nothing Nothing to voNode5
								Handle hoNode5
								Get Create (RefClass(cComNode)) to hoNode5
								Set pvComObject of hoNode5 to voNode5
									Set ComValue of hoNode5 to 101
								Send Destroy to hoNode5
								Variant voNode6
								Get ComAdd of hoNodes3 "Sub Child <b>2.2.2" Nothing Nothing to voNode6
								Handle hoNode6
								Get Create (RefClass(cComNode)) to hoNode6
								Set pvComObject of hoNode6 to voNode6
									Set ComValue of hoNode6 to 102
								Send Destroy to hoNode6
							Send Destroy to hoNodes3
							Set ComExpanded of hoNode4 to True
						Send Destroy to hoNode4
					Send Destroy to hoNodes2
					Set ComExpanded of hoNode2 to True
				Send Destroy to hoNode2
			Send Destroy to hoNodes1
			Set ComSelected of hoNode to True
			Set ComExpanded of hoNode to True
		Send Destroy to hoNode
	Send Destroy to hoNodes
	Set ComLevelWidth 0 to 64
	Set ComLevelWidth 1 to 96
	Set ComLevelWidth 2 to 96
	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 oNode,oNode1,oNode2
	LOCAL oNodes,oNodes1,oNodes2
	LOCAL oXMLGrid

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

	oXMLGrid := XbpActiveXControl():new( oForm:drawingArea )
	oXMLGrid:CLSID  := "Exontrol.XMLGrid.1" /*{AC7F976E-48C3-4B0B-B952-45D92DFE7F3E}*/
	oXMLGrid:create(,, {10,60},{610,370} )

		oXMLGrid:BeginUpdate()
		oXMLGrid:SelBackMode := 1/*exTransparent*/
		oXMLGrid:SetProperty("SelBackColorChild",oXMLGrid:SelBackColor())
		oNode := oXMLGrid:Nodes():Add("Parent")
			oNodes := oNode:Nodes()
				oNodes:Add("Child <b>1"):Value := 100
				oNode1 := oNodes:Add("Child <b>2")
					oNodes1 := oNode1:Nodes()
						oNodes1:Add("Sub Child <b>2.1"):Value := 101
						oNode2 := oNodes1:Add("Sub Child <b>2.2")
							oNodes2 := oNode2:Nodes()
								oNodes2:Add("Sub Child <b>2.1.1"):Value := 101
								oNodes2:Add("Sub Child <b>2.2.2"):Value := 102
							oNode2:Expanded := .T.
					oNode1:Expanded := .T.
			oNode:Selected := .T.
			oNode:Expanded := .T.
		oXMLGrid:SetProperty("LevelWidth",0,64)
		oXMLGrid:SetProperty("LevelWidth",1,96)
		oXMLGrid:SetProperty("LevelWidth",2,96)
		oXMLGrid:EndUpdate()

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