Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - [SOLVED] Best way to limit input in cell
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] Best way to limit input in cell

 Post Reply Post Reply
Author
Message
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] Best way to limit input in cell
    Posted: 02 April 2011 at 4:06pm
I have cells that I want to allow input of numbers only, what is the best way to do this? I don't see a keypress event, is the "previewkeydown" event the only way to do this?
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 64 bit
Language: Visual Basic 6.0


Back to Top
markmark View Drop Down
Senior Member
Senior Member


Joined: 30 November 2007
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote markmark Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2011 at 10:27am
This is how I have done this
 
Private Sub wndReport_InplaceEditChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, newValue As String, Cancel As Boolean)
If Len(newValue) <> 0 Then
    Cancel = Not IsNumeric(newValue)
End If
End Sub
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 03 April 2011 at 11:56am

Hi,

You can also prevent user from typing non numerical characters... And following does for entire column. You can also set this for single ReportItem when adding records.

 

        With wndReportControl

            .AllowEdit = True
            With .Columns
                With .Add(.Count, "Col 1", 100, True)
                    .EditOptions.EditControlStyle = xtpEditStyleNumber
                End With
            End With
        End With
 
 
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
wakerunner View Drop Down
Groupie
Groupie


Joined: 29 September 2007
Status: Offline
Points: 85
Post Options Post Options   Thanks (0) Thanks(0)   Quote wakerunner Quote  Post ReplyReply Direct Link To This Post Posted: 06 April 2011 at 2:13pm
Great, thanks for the help!
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 64 bit
Language: Visual Basic 6.0


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.