FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : InvalidOption Property |
'Declaration Public Overridable Property InvalidOption As InvalidOption
'Usage Dim instance As SuperEditBase Dim value As InvalidOption instance.InvalidOption = value value = instance.InvalidOption
public virtual InvalidOption InvalidOption {get; set;}
When 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.
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; } }
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