ASPxGridBase.FilterControlCriteriaValueEditorInitialize Event
Fires when an editor in the criteria value is initialized.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
Declaration
public event FilterControlCriteriaValueEditorInitializeEventHandler FilterControlCriteriaValueEditorInitialize
Event Data
The FilterControlCriteriaValueEditorInitialize event's data class is FilterControlCriteriaValueEditorInitializeEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Column | Gets the column whose editor is being initialized. |
Editor | Gets the processed editor. |
Value | Gets the processed editor value. |
Remarks
The FilterControlCriteriaValueEditorInitialize
event enables you to customize criteria value editor properties.
The event parameter’s Column property identifies the column whose editor is being initialized. The processed editor is returned by the Editor property. Its value is returned by the Value property.
protected void grid_FilterControlCriteriaValueEditorInitialize(object sender, FilterControlCriteriaValueEditorInitializeEventArgs e) {
if(e.Value == null)
return;
if(e.Column.PropertyName == "Value") {
InitializeSpinEdit(e.Editor, e.Value);
}
}
void InitializeSpinEdit(ASPxEditBase editor, object value) {
var spinEdit = editor as ASPxSpinEdit;
var intValue = (int)value;
spinEdit.BackColor = Color.LightGreen;
if(intValue > 10)
spinEdit.BackColor = Color.Orange;
if(intValue > 100)
spinEdit.BackColor = Color.Red;
if(intValue > 1000)
spinEdit.BackColor = Color.DarkRed;
if(intValue > 10000)
spinEdit.BackColor = Color.Black;
}
See Also