Example
#In this example we use the OnSetDisplayItemText event to change the text of tree nodes based on the tree node level. Tree nodes may display any text, but you will can only edit Text that is required from the field – ListField.
procedure TForm1.dxDBTreeViewSetDisplayItemText(Sender: TObject;
var DisplayText: string);
Var
tr : TTreeNode;
begin
// Get TreeNode
tr := dxDBTreeView.DBTreeNodes.GetTreeNode(TreeQueryID.Value);
if tr <> Nil then begin
if tr.Level mod 2 = 1 then
DisplayText := Field1.Text
else DisplayText := Field2.Text;
end;
end;