Spread Windows Forms 8.0 Product Documentation
InvalidOption Property
Example 


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
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

SuperEditBase Class
SuperEditBase Members
InvalidOption Enumeration
AllowNull Property
InvalidData Event

 

 


Copyright © GrapeCity, inc. All rights reserved.