Hi..
I am working in ASP.NET and i want to use GridView with RangeValidator control. How can we use it and define all property for the GridView and RangeValidator?
RangeValidator control
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Satyapriya NayakRank #47 · 31.5K reputationPosted Feb 2, 2012, 7:31 PM EST
RangeValidator for Age Field
RangeValidator validates the input to fall between the specified range of MinimumValue and MaximumValue property. We can also mention the validation data type through the Type property of the RangeValidator. The code for creating and binding a RangeValidator with GridView control is as follows
RangeValidator rangevalidator = new RangeValidator();
rangevalidator.ID = "RangeValidator1";
rangevalidator.ControlToValidate = "TextBox3";
rangevalidator.ErrorMessage = "Invalid Age";
rangevalidator.MaximumValue = "100";
rangevalidator.MinimumValue = "0";
rangevalidator.SetFocusOnError = true;
rangevalidator.Type = ValidationDataType.Integer;
e.Row.Cells[2].Controls.Add(rangevalidator);
Please refer the below link
http://www.aspdotnetcodes.com/GridView_Dynamic_Validation.aspx
Thanks