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(

       ID,

       Namespace,

       ClientData)

 

C#

 

void SetClientData(

       string ID,

       string Namespace,

       string ClientData)

 

C++

 

HRESULT SetClientData(

       BSTR ID,

       BSTR Namespace,

       BSTR ClientData) 

Parameters

ID

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

Cannot use Tree root for this operation

TE_E_INFOTREE_ITEMISGROUP

Item ID is a group so an object cannot be retrieved.