Skip to main content

TcxTreeListReportLinkStyles.OnGetNodeIndentStyle Event

Occurs whenever the node indent within the report needs repainting.

Declaration

property OnGetNodeIndentStyle: TcxTreeListGetNodeIndentStyleEvent read; write;

Remarks

The OnGetNodeIndentStyle event occurs every time the TreeList node indent within the report is about to be painted. This allows you to substitute the assigned node indent style for any other style.

To change the style, you should write an event handler that passes the existing instance of the TcxStyle class to the control via the AStyle parameter. Note that the AStyle parameter doesn’t represent any TcxStyle instance and by default is nil. So you couldn’t implement the following code before you assign a TcxStyle instance to it:

AStyle.Assign(MyStyle) or AStyle.Color := clBlack

The following code is not recommended either:

AStyle := TcxStyle.Create;

In this case, a TcxStyle instance will be created every time the event occurs and will be never deleted until the application terminates. Implementing the above code creates excessive TcxStyle instances and excessive memory usage as a result. The proper method is to create a TcxStyle instance outside the event handler, then pass it to the control via the AStyle parameter within the event handler. For instance, you could use the StyleRepository to create and store your custom styles.

The Sender parameter of the event contains a TreeList control instance that owns the style collection.

The ANode parameter contains a TreeList node instance whose indent is repainted.

See Also