Spread Windows Forms 11.0 Product Documentation
InvalidOption Property
Example 


FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : InvalidOption Property
Gets or sets whether invalid data is displayed, hidden, or cleared when the control loses the focus.
Syntax
'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;}

Property Value

InvalidOption setting that determines how to handle invalid data
Remarks

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.

Example
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
See Also

Reference

SuperEditBase Class
SuperEditBase Members
InvalidOption Enumeration
AllowNull Property
InvalidData Event