validation of the spread cell

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

  • Posted 8 September 2017, 1:15 pm EST

    <P>hello sir,</P>
    <P>I want validate the spread cell such that the user can</P>
    <P>enter only numbers. I cant use the celltype in the spread design</P>
    <P>as the maximum value that can be entered is 99999999999999(14 times).</P>
    <P>i am in a requirement such that i should be able to show 9(60 times).</P>
    <P>so how can i validate the cell such that only numbers are entered into the cell.</P>
    <P>i used the following method,,</P>
    <P>Private Sub spdSampleIndex_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles spdSampleIndex.KeyPress</P>
    <P>    If (Asc(e.KeyChar) >= 48 Or Asc(e.KeyChar) <= 57) Then<BR>            MsgBox(Asc(e.KeyChar))</P>
    <P>        End If</P>
    <P>end sub</P>
    <P>so that for every key press i can check if the key pressed is a number or not.</P>
    <P>but the key press event is not getting triggered  every time the number is entered .</P>
    <P>instead it is getting triggered only for the first time the key is pressed in the cell.</P>
    <P>so can u please tell me which event i can use to check for every key that is pressed in the spread cell.</P>
    <P>thanking you.</P>
  • 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.<br>
  • Replied 8 September 2017, 1:15 pm EST

    <P>hi Bob,</P>
    <P>thanks a lot, it made my work very simple and efficient.</P>
Need extra support?

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

Learn More

Forum Channels