Datagrid Edit validation

  • Thread starter Thread starter G Dean Blake
  • Start date Start date
G

G Dean Blake

Is the any way to use a regularexpressionvalidator to validate information
entered in a datagrid after the rows edit button is pushed?

I know I can do it server side but I want to do it client side if I can.
thanks,
G
 
Hi G:

You can add the validation control to the EditItemTemplate:

<EditItemTemplate>
<asp:TextBox runat="server" id="edit_Phone"
...
/>
<asp:RequiredFieldValidator
ControlToValidate="edit_Phone"
...
/>
<asp:RegularExpressionValidator
ControlToValidate="edit_Phone"
ValidationExpression="[0-9]{3} [0-9]{3}-[0-9]{4}"
...
/>
</EditItemTemplate>

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top