Customizing the Tree View - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

A number of projects have had requirements to make changes to the tree view, and normally most of them are to change the behavior of drag/drop. To replace the SmartPlant Foundation tree view with a custom version, you need to create a new class that inherits from SPFTreeview.

Namespace SPF.Client.Forms

Public Class CustomTreeview

Inherits SPFTreeview

There is an example in the training client assembly that changes the behavior of drag/drop. You need to edit the DesktopClient.exe.config file to tell the client where to pick up the control from. In the client we use the tree view for the New Items window and for the standard tree view above it. In the example below we replace 'newItemsTreeview' to replace the main tree view use the key 'treeview'.

<customControls>

<newItemsTreeview assembly="SPF.Client.Training.dll" class="SPF.Client.Forms.CustomTreeview" />

</customControls>

For the 'class' key, you specify the name of class that you defined in your code. In this case it is 'CustomTreeview' prefixed with the namespace.