New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Validate Template columns with RegularExpressionValidator.


Product Telerik WebForms Grid for ASP.NET AJAX


Invalid Email

Sometimes, one might want to validate certain text fields to check if proper values have been typed (email, phone number, etc), while editing.


To do so, add a RegularExpressionValidator inside the EditItemTemplate of the GridTemplateColumn

    <telerik:GridTemplateColumn HeaderText="Email" SortExpression="Email" UniqueName="Email">
            <telerik:RadTextBox ID="editTextBox" runat="server" Text='<%# Bind("Email") %>' />
            <asp:RegularExpressionValidator ID="emailValidator2" runat="server" Display="Static" ControlToValidate="editTextBox" CssClass="textColor"
                ErrorMessage="Please, enter valid e-mail address." ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$">
            <telerik:RadLabel ID="txtBox" runat="server" Text='<%# Bind("Email") %>' />
    .textColor {
        color: red;
In this article