GrapeCity MultiRow Windows Forms Documentation
ValidateActionContext Class
Members  Example 


Provides relative context information when the CellValidateAction executes.
Object Model
ValidateActionContext ClassCellPosition StructureGcMultiRow Class
Syntax
Public Class ValidateActionContext 
   Inherits ValidateContext
Dim instance As ValidateActionContext
public class ValidateActionContext : ValidateContext 
Remarks
This class provides information when executing the CellValidateAction. You can get the validated Cell's context information and the validation result. You can use this information to execute actions if the validation fails. You can keep the focus on the validated cell by setting the KeepFocus property when executing CellValidateAction.DoAction.
Example
The following code example shows how to customize a CellValidator, and how to 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
Inheritance Hierarchy

System.Object
   GrapeCity.Win.MultiRow.ValidateContext
      GrapeCity.Win.MultiRow.ValidateActionContext

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

ValidateActionContext Members
GrapeCity.Win.MultiRow Namespace
CellValidator Class
CellValidateAction Class
ValidateContext Class

 

 


Copyright © GrapeCity, inc. All rights reserved.