CustomJSPropertiesEventArgs.Properties Property
Gets a collection of temporary client properties.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.2.dll
Declaration
public Dictionary<string, object> Properties { get; }
Public ReadOnly Property Properties As Dictionary(Of String, Object)
Property Value
Type | Description |
---|---|
Dictionary<String, Object> | The collection of property names and values. |
Remarks
Use the event parameter's Properties property to add new properties that can be accessed on the client.
NOTE
The only requirement is that property names must begin with the 'cp' prefix to avoid rewriting the object's base properties.
Example
Web Forms:
<dx:ASPxGridView ID="grid" OnCustomJSProperties="GridView_CustomJSProperties" ...>
...
</dx:ASPxGridView>
protected void GridView_CustomJSProperties(object sender, ASPxGridViewClientJSPropertiesEventArgs e) {
e.Properties["cpVisibleRowCount"] = grid.VisibleRowCount;
e.Properties["cpFilteredRowCountWithoutPage"] = GetFilteredRowCountWithoutPage();
}
function GetSelectedFilteredRowCount() {
return grid.cpFilteredRowCountWithoutPage + grid.GetSelectedKeysOnPage().length;
}
MVC:
settings.CustomJSProperties = (s, e) => {
var grid = s as MVCxGridView;
e.Properties["cpVisibleRowCount"] = grid.VisibleRowCount;
e.Properties["cpFilteredRowCountWithoutPage"] = GetFilteredRowCountWithoutPage(grid);
};
function GetSelectedFilteredRowCount() {
return grid.cpFilteredRowCountWithoutPage + grid.GetSelectedKeysOnPage().length;
}
Online Example
ASPxGridView - Batch Editing - How to cancel editing or disable the editor conditionally
Online Demo
See Also
Feedback