ASPxTreeList.JSProperties Property

Gets a collection of temporary client properties.

Namespace: DevExpress.Web.ASPxTreeList

Assembly: DevExpress.Web.ASPxTreeList.v20.2.dll


public Dictionary<string, object> JSProperties { get; }
Public ReadOnly Property JSProperties As Dictionary(Of String, Object)

Property Value

Type Description
Dictionary<String, Object>

The collection of property names and values.


Use the JSProperties property to add new properties that can be accessed on the client.


The only requirement is that property names must begin with the 'cp' prefix (acronym for 'client property'), to avoid rewriting the ASPxTreeList base properties.

// Scalar value
ASPxTreeList1.JSProperties["cpScalar"] = "my value";

// Nested arrays
ASPxTreeList1.JSProperties["cpNestedArrays"] = new object[] { 
        new string[] { "name1", "name2" }};

// Hashtable
Hashtable hash = new Hashtable();
hash.Add("key", "value");
ASPxTreeList1.JSProperties["cpHash"] = hash;

The following code demonstrates how the grid's current page index can be passed to and obtained on the client side.

ASPxTreeList1.JSProperties["cpPageIndex"] = ASPxTreeList1.PageIndex;
See Also