TreeListNodeValidationEventArgs.NewValues Property
Gets a dictionary that contains the values of the non-key field name/value pairs in the node to be validated.
Namespace: DevExpress.Web.ASPxTreeList
Assembly: DevExpress.Web.ASPxTreeList.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
OrderedDictionary | A System.Collections.Specialized.OrderedDictionary object that contains the values of the non-key field name/value pairs in the node to be validated. |
Example
This example demonstrates how to check the validity of data entered by end-users into a node. Validation is implemented within the ASPxTreeList.NodeValidating event handler. In this sample, validation fails in the cases listed below:
- the department isn’t specified;
- the budget is negative.
The image below shows the result:
protected void ASPxTreeList1_NodeValidating(object sender, TreeListNodeValidationEventArgs e) {
if ((int)e.NewValues["Budget"] < 0)
e.Errors["Budget"] = "Negative values aren't allowed";
if (e.NewValues["Department"] == null)
e.Errors["Department"] = "Required field";
if (e.Errors.Count != 0)
e.NodeError = "Node update failed. Please check node values.";
}
See Also