Rangevalidation GridNumericColumn in EditMode="Batch"

3 posts, 0 answers
  1. Sébastien
    Sébastien avatar
    12 posts
    Member since:
    Apr 2016

    Posted 26 Jul Link to this post

    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 :)

     

  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1801 posts

    Posted 29 Jul Link to this post

    Hello,

    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
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sébastien
    Sébastien avatar
    12 posts
    Member since:
    Apr 2016

    Posted 29 Jul in reply to Konstantin Dikov Link to this post

    Hello,

    Thank you for your reply.

    Ok, I will do so.

    Best Regards,

    Sébastien

Back to Top