Hi,
Using the RadGrid in Batch Editing mode and the EditType is set to row.
What is the best way to implement a RangeValidation for a GridNumericColumn ? I
I just want the user having to enter a value between 1 and 999. If this is not the case, a small message indicates the error.
Thanks in advance to show me the way :)
6 Answers, 1 is accepted
The easiest way for achieving the desired result is by setting the MinValue and MaxValue properties of the GridNumericColumn, which will automatically enable the range validation:
<
Columns
>
<
telerik:GridNumericColumn
DataField
=
"Age"
MinValue
=
"0"
MaxValue
=
"100"
></
telerik:GridNumericColumn
>
</
Columns
>
As for displaying error message, this could be achieved with custom validator control. You can refer to the following demo, where you will see how RequiredFieldValidator is used, but in your case you will need CustomValidator:
Best Regards,
Konstantin Dikov
Telerik by Progress
Hello,
Thank you for your reply.
Ok, I will do so.
Best Regards,
Sébastien
Konstantin,
In the sample you posted above a red exclamation point appears briefly when a non-numeric character is entered. We have been trying to either get that to not appear or to display something useful like "You have entered an invalid character" and stay up on the screen. Are either of these possible?
Jimmy
I researched the case and for your convenience and I created a KB article on the matter. You can find it here:
Use a ToolTip as a Feedback for Input Controls as a Validation Message
The article covers in details how to create and show a tooltip using the RadToolTipManager.
Let me know if you need further clarifications.
Kind r,
Tsvetomir
Progress Telerik
Hi Tsvetomir,
For some reason i was unsuccessful to adopt your example for "batch" mode.
Any recommendations?
Hi David,
Worth checking out the following Forum thread regarding the Batch Validation issue: Rad Grid Batch Editing Validation not working.
Also, you may check the our Validation help article for RadGrid with Batch Editing.
If the links above did not help fix the issue, I suggest that you open a formal support ticket and share more information about the current configuration. Since Tsvetomir's example is made with a Grid for other edit mode than Batch, this case may need to be addressed differently. Once we see the current scenario/configuration you have, will be able to tell how to fix the issue or implement Tsvetomir's solution.
Later we could also share the solution in this thread to make it available for others as well.
Kind regards,
Attila Antal
Progress Telerik