Home > Working with SGWorld > ProjectTree (IProjectTree6) > SetClientData
This method stores a text string in the Project Tree item’s global namespace. for the purpose of describing the item or any other purpose. You can store several text strings by using different Namespaces. You can read this string by using the GetClientData () method.
Note: The SetClientData method stores the text string in the global Namespace. You can access the global namespace by passing an empty string for the Namespace parameter.
JavaScript |
|
SetClientData( ItemID, Namespace, ClientData) |
C# |
|
void SetClientData( int ItemID, string Namespace, string ClientData) |
C++ |
|
HRESULT SetClientData( LONG_PTR ItemID, BSTR Namespace, BSTR ClientData) |
Parameters:
ItemID
The item whose client data we set
Namespace
The identifier of the text string. You can store several text strings in the group by using different namespaces. You must use the correct namespace when accessing the client data using the GetClientData () method.
ClientData
A text string. Note that the input string should not contain the formatting characters '\n' and '\r'.
Exceptions
HRESULT can return any of the values listed in the HRESULT Return Values list, as well as the following values:
TE_E_INFOTREE_PARENTNOTGROUP |
The group ID entered does not represent a valid group in the project tree. |
TE_E_INFOTREE_ITEMNOTGROUP |
The item entered is not a group and therefore cannot be used as a group. |
TE_E_INFOTREE_CANTUSEROOT |
Can not use tree root for this operation |
TE_E_INFOTREE_ITEMISGROUP |
ItemID is a group so an object cannot be retrieved. |