Allow only numeric value in a cell (100.00)

Posted by: jonathanlau2828 on 5 March 2019, 10:00 pm EST

  • Posted 5 March 2019, 10:00 pm EST


    How do we restrict the users to type only numeric value (e.g. 999.00) in a cell?

  • Replied 6 March 2019, 10:24 pm EST

    Please refer to the following demo sample to allow the enter the numeric fields only:

    Manish Gupta
  • Replied 12 March 2019, 12:04 am EST

    Hi Manish,

    Thanks for the demo sample link. However, we want to restrict the users from entering non-numeric values in the key press event itself. Any suggestion how it can be implemented?

  • Marked as Answer

    Replied 13 March 2019, 12:17 am EST

    Hi Kamal,
    You may handle the EditStart client-side event and handle the keyup event and replace the nonnumeric value with "".
    Please refer to the following code snippet:

    function EditStart(s) {
    setTimeout(function () {
    s.cell.querySelector("input").addEventListener("keyup", function (e) {
    var val = this.value;
    this.value=val.replace(/[^\0-9]/ig, "");


    <FarPoint:FpSpread ID="FpSpread1" runat="server" ClientEvents-EditStart="EditStart" Height="200" Width="400">

    Please refer to the attached sample for reference.

    Manish Gupta
  • Replied 20 March 2019, 8:38 pm EST

    Hi Manish,

    The sample you provided solved our problem. Thank you.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels