GrapeCity MultiRow Windows Forms Documentation
DoAction Method (CellValidateAction)
Example 


A ValidateActionContext value that indicates whether the validation failed and that contains some relative context information.
Executes the current CellValidateAction using the context.
Syntax
Protected MustOverride Sub DoAction( _
   ByVal context As ValidateActionContext _
) 
Dim instance As CellValidateAction
Dim context As ValidateActionContext
 
instance.DoAction(context)
protected abstract void DoAction( 
   ValidateActionContext context
)

Parameters

context
A ValidateActionContext value that indicates whether the validation failed and that contains some relative context information.
Example
The following code example shows how to customize a CellValidator and add a customized CellValidateAction. This example is part of a larger example available for the CellValidator class.
class MyIconNotifyAction : IconNotify
        {
            protected override void DoAction(ValidateActionContext context)
            {
                base.DoAction(context);
                //When the error icon pops up, a system sound plays at the same time.
                if (!context.IsValid)
                {
                    System.Media.SystemSounds.Asterisk.Play();
                }
            }
        }
Private Class MyIconNotifyAction
        Inherits IconNotify
        Protected Overloads Overrides Sub DoAction(ByVal context As ValidateActionContext)
            MyBase.DoAction(context)
            'When the error icon pops up, a system sound plays at the same time.
            If Not context.IsValid Then
                System.Media.SystemSounds.Asterisk.Play()
            End If
        End Sub
    End Class
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CellValidateAction Class
CellValidateAction Members

 

 


Copyright © GrapeCity, inc. All rights reserved.