Spread Windows Forms 7.0 Product Documentation
InvalidOption Property
See Also  Example Support Options
FarPoint.Win Assembly > FarPoint.Win Namespace > SuperEditBase Class : InvalidOption Property


Glossary Item Box

Gets or sets whether invalid data is displayed, hidden, or cleared when the control loses the focus.

Syntax

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

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

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

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.