A newer version of this page is available. Switch to the current version.

ASPxScheduler.CustomJSProperties Event

Enables you to supply any server data that can then be parsed on the client.

Namespace: DevExpress.Web.ASPxScheduler

Assembly: DevExpress.Web.ASPxScheduler.v18.2.dll


public event CustomJSPropertiesEventHandler CustomJSProperties
Public Event CustomJSProperties As CustomJSPropertiesEventHandler

Event Data

The CustomJSProperties event's data class is CustomJSPropertiesEventArgs. The following properties provide information specific to this event:

Property Description
Properties Gets a collection of temporary client properties.


Sometimes it is necessary to obtain server information on the client side. The CustomJSProperties event enables you to declare temporary client properties to store the necessary information. Once declared, a property can be accessed on the client using common syntax.

Add new properties via the event parameter's Properties property, which represents a collection of property names and their values. You have to add "cp" prefix to custom property names, in order to avoid rewriting the base properties. The code snippet below provides an illustration of this:

protected void ASPxScheduler1_CustomJSProperties(object sender, 
DevExpress.Web.CustomJSPropertiesEventArgs e) {
    e.Properties.Add("cpFirstDayOfWeek", ASPxScheduler1.FirstDayOfWeek);
    e.Properties["cpNestedArrays"] = new object[] { 
    new string[] { "name1", "name2" }};

The CustomJSProperties event is raised on callbacks. You may check for this to prevent a variable from unnecessary initialization:

if (!IsCallback) {
    e.Properties.Add("cpFirstDayOfWeek", ASPxScheduler1.FirstDayOfWeek);

Then, you can obtain a custom property's value via the client object's cpMyProperty:

alert (scheduler.cpFirstDayOfWeek);

On server it can be accessed by means of ASPxScheduler.JSProperties property.

ASPxScheduler1.JSProperties["cpFirstDayOfWeek"] = "AnyScalarValue";
See Also