Visual Basic (Declaration) | |
---|---|
Public Overridable Property InvalidOption As InvalidOption |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As SuperEditBase Dim value As InvalidOption instance.InvalidOption = value value = instance.InvalidOption |
C# | |
---|---|
public virtual InvalidOption InvalidOption {get; set;} |
Property Value
InvalidOption setting that determines how to handle invalid dataWhen you set this property to InvalidOption.ClearData for a bound control and it reads an invalid value from the database, the invalid value is permanently removed from the database when you update the record. However, invalid values supplied by the user are not written to the database and the existing value in the database field remains unchanged.
This property is available from the SuperEditBase class.
You can determine the validity of data in a control by returning the value of the IsValid method.
An InvalidData event occurs when a control that contains invalid data loses the focus.
C# | Copy Code |
---|---|
privatevoidForm1_Load(objectsender,System.EventArgse) { control.Text="Hi"; control.InvalidOption=FarPoint.Win.InvalidOption.ShowData; } privatevoidcontrol_MouseDown(objectsender,System.Windows.Forms.MouseEventArgse) { boolbvalue; bvalue=control.IsValid(); if(bvalue==false) { control.Value=500; } } |
Visual Basic | Copy Code |
---|---|
PrivateSubForm1_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
control.Text="Hi"
control.InvalidOption=FarPoint.Win.InvalidOption.ShowData
EndSub
PrivateSubcontrol_MouseDown(ByValsenderAsObject,ByValeAsSystem.Windows.Forms.MouseEventArgs)HandlesCurrency1.MouseDown
DimbvalueAsBoolean
bvalue=control.IsValid()
Ifbvalue=FalseThen
control.Text=500
EndIf
EndSub |
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8