validation of the spread cell

Posted by: dini on 8 September 2017, 1:15 pm EST

  • Posted 8 September 2017, 1:15 pm EST

    hello sir,

    I want validate the spread cell such that the user can

    enter only numbers. I cant use the celltype in the spread design

    as the maximum value that can be entered is 99999999999999(14 times).

    i am in a requirement such that i should be able to show 9(60 times).

    so how can i validate the cell such that only numbers are entered into the cell.

    i used the following method,,

    Private Sub spdSampleIndex_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles spdSampleIndex.KeyPress

        If (Asc(e.KeyChar) >= 48 Or Asc(e.KeyChar) <= 57) Then

            End If

    end sub

    so that for every key press i can check if the key pressed is a number or not.

    but the key press event is not getting triggered  every time the number is entered .

    instead it is getting triggered only for the first time the key is pressed in the cell.

    so can u please tell me which event i can use to check for every key that is pressed in the spread cell.

    thanking you.

  • Replied 8 September 2017, 1:15 pm EST

    It might be much easier if you used the TextCellType and set the CharacterSet to numbers only.
  • Replied 8 September 2017, 1:15 pm EST

    hi Bob,

    thanks a lot, it made my work very simple and efficient.



Need extra support?

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

Learn More

Forum Channels