You have done it correctly. The only issues are:
1. The RangeValidator doesn't report an error when the field is empty.
Assign RequiredFieldValidator.
2. The RangeValidator doesn't report an error when the field contains a
value that does not match the Type property, like "abc" is illegal for
Type="integer". Assign a CompareValidator, Operator=DataTypeCheck,
Type=Integer.
--- Peter Blum
www.PeterBlum.com
Email:
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
"tshad" <> wrote in message
news:...
> Can you do Range Validation inside of an EditItemTemplate of the DataGrid?
>
> I have one set up as:
>
> ******************************************
> <td>
> <asp:TextBox Columns="3" id="Weight" runat="server" Text='<%#
> DataBinder.Eval(Container.DataItem, "Weight") %>' />
> <asp:RangeValidator
> ControlToValidate="Weight"
> MinimumValue="1"
> MaximumValue="10"
> Type="Integer"
> Text="The Value must be be from 1 to 10!"
> runat="server"/>
> </td>
> ************************************************** *************
>
> But nothing seems to happen when I push the update button.
>
> It takes whatever value I put in and doesn't seem to check it.
>
> Thanks,
>
> Tom
>