Back to Devexpress

ASPxGridViewClientJSPropertiesEventArgs Class

aspnet-devexpress-dot-web-ae456e7b.md

latest2.9 KB
Original Source

ASPxGridViewClientJSPropertiesEventArgs Class

Provides data for the ASPxGridView.CustomJSProperties event.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public class ASPxGridViewClientJSPropertiesEventArgs :
    CustomJSPropertiesEventArgs
vb
Public Class ASPxGridViewClientJSPropertiesEventArgs
    Inherits CustomJSPropertiesEventArgs

ASPxGridViewClientJSPropertiesEventArgs is the data class for the following events:

Remarks

The ASPxGridView.CustomJSProperties event enables you to supply any server data via the temporary properties, that can be then accessed on the client. The CustomJSPropertiesEventArgs.Properties property represents a collection of property names and values. Note that property names must begin with the ‘cp’ prefix to avoid rewriting the ASPxGridView base properties.

Example

This example demonstrates how to obtain server data from the client. A temporary client property— cpPageIndex —is declared within the ASPxGridView.CustomJSProperties event handler. This property holds the index of the currently active page, and can be accessed on the client side.

csharp
protected void ASPxGridView1_CustomJSProperties(object sender,
   DevExpress.Web.ASPxGridViewClientJSPropertiesEventArgs e) {
    e.Properties["cpPageIndex"] = ASPxGridView1.PageIndex;
}
vb
Protected Sub ASPxGridView1_CustomJSProperties(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridViewClientJSPropertiesEventArgs)
    e.Properties("cpPageIndex") = ASPxGridView1.PageIndex
End Sub
aspx
<input id="Button1" type="button" value="Active Page" onclick="alert(grid.cpPageIndex)" />

Inheritance

Object EventArgs CustomJSPropertiesEventArgs ASPxGridViewClientJSPropertiesEventArgs

See Also

ASPxGridViewClientJSPropertiesEventArgs Members

Grid View

DevExpress.Web Namespace