# Validation

The **RadCloudUpload** control allows you to validate the files that the end user has selected. For this purpose you can use the **ValidationRules** property. It is of type **List\<System.Windows.Controls.ValidationRule>** and expects you to provide validation rules.

> You can read the [Create Custom Validation Rule](https://www.telerik.com/products/wpf/documentation/controls/radcloudupload/how-to/howto-create-custom-validation-rule) help article.

The **Validate()** method of each rule will be executed providing the selected file's name. If there are no validation rules, or all rules return valid result - a valid item is created. In case there is at least one rule that returns an invalid result - an invalid item is created for this file.

> Validation is executed once the user selects file(s). If later you add or remove validation rules, the files will not be reevaluated.

There is a built-in validation rule (**CloudUploadFileSizeValidationRule**) that can be used to validate the size of the files. **Example 1** demonstrates how you can use the rule.

**Example 1: Adding a validation rule**

```XAML
<telerik:RadCloudUpload>
    <telerik:RadCloudUpload.ValidationRules>
        
        <telerik:CloudUploadFileSizeValidationRule MaxFileSize="10000000" />
    </telerik:RadCloudUpload.ValidationRules>
</telerik:RadCloudUpload>
```

## See Also

* [Create Custom Validation Rule](https://www.telerik.com/products/wpf/documentation/controls/radcloudupload/how-to/howto-create-custom-validation-rule)
* [Open File Dialog](https://www.telerik.com/products/wpf/documentation/controls/radcloudupload/features/custom-open-file-dialog)
* [ValidationRule](http://msdn.microsoft.com/en-us/library/system.windows.controls.validationrule.aspx)
