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:
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:
Telerik by Progress
Thank you for your reply.
Ok, I will do so.
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?
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.
For some reason i was unsuccessful to adopt your example for "batch" mode.
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.