Print Page | Close Window

[SOLVED] Best way to limit input in cell

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=18156
Printed Date: 05 May 2024 at 7:52pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] Best way to limit input in cell
Posted By: wakerunner
Subject: [SOLVED] Best way to limit input in cell
Date 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





Replies:
Posted By: markmark
Date 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


Posted By: Aaron
Date 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....


Posted By: wakerunner
Date 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





Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net