Print Page | Close Window

validating empty cell on Value changed ?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=11198
Printed Date: 04 May 2024 at 7:31am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: validating empty cell on Value changed ?
Posted By: BoboP
Subject: validating empty cell on Value changed ?
Date Posted: 25 June 2008 at 3:31am
Hi !
I used values changed event to identify if cell value is empty . But if cell value is empty and it looses its focus , values changed event does not get fired.
It fires only if you types something.
Now my problem id prevent user from keeping some cells empty . How to do that

Help !



Replies:
Posted By: Aaron
Date Posted: 25 June 2008 at 4:29am
Hi,
 
Add items with default values. User knows what to enter (value or chars) and you don't have to check the empty fields. You only have to check if an item has been changed.


-------------
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: BoboP
Date Posted: 25 June 2008 at 6:06am
Hi,

Thanks for replying..
I can give default values but is there any other way , we can check for mandatory fields ? And warn user for empty fields?




Posted By: Aaron
Date Posted: 25 June 2008 at 6:56am
Hi,
 
Private Sub wndPropertyGridFiles_AfterEdit(ByVal Item As XtremePropertyGrid.IPropertyGridItem, NewValue As String, Cancel As Boolean)
    If NewValue = Empty Then
        MsgBox "This field is required, cannot be empty"
        Cancel = False ' I would expect this to work but it isn't :(
    End If
End Sub
 
This event fires also when no value or same value is entered. But it should be selected again if cancel = false. I ask myself what the purpose of cancel in this event is


-------------
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....



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