GrapeCity MultiRow Windows Forms Documentation
IconNotify Class
Members  Example 


Represents a special AppearanceActionBase that displays an error icon for the validating Cell when validation fails.
Syntax
<ToolboxBitmapAttribute()>
<DefaultPropertyAttribute("IconTip")>
Public Class IconNotify 
   Inherits AppearanceActionBase
   Implements INamedObject 
Dim instance As IconNotify
[ToolboxBitmap()]
[DefaultProperty("IconTip")]
public class IconNotify : AppearanceActionBase, INamedObject  
Remarks

If the action is executed the error icon appears regardless of the ShowCellErrors or ShowRowErrors or ShowErrorIconInEditingStatus setting.

The error icon appears during edit mode.

If the IconTip property value is a null reference (Nothing in Visual Basic) or String.Empty, the error icon text uses ValidateContext.ValidateInfo.
Example
The following code example uses the IncludeListValidator to validate whether the input value is included in the "null,2,3,4,5" list. If you input 1 in the Cell, then move the current cell to another cell, an error glyph icon is displayed to show the validation failed. If you input 2 in the cell, then move the current cell to another cell, no error glyph icon is displayed, and the validation is successful. This example is part of a larger example available for the CellValidator class.
void setIncludeListValidator_Click(object sender, EventArgs e)
        {
            Template template = Template.CreateGridTemplate(1);

            IncludeListValidator includeListValidator = new IncludeListValidator();
            includeListValidator.Candidates = new string[] { null, "2", "3", "4", "5" };

            IconNotify iconNotify = new IconNotify();
            iconNotify.IconAlignment = ContentAlignment.MiddleCenter;
            iconNotify.IconTip = "The editing value is not within the specified candidate list!";
            //When CurrentCell move to another Cell, the action will be done.
            iconNotify.DoActionReason = ValidateReasons.CellValidating;

            includeListValidator.Actions.Add(iconNotify);

            template.Row.Cells[0].Validators.Add(includeListValidator);

            this.gcMultiRow1.Template = template;
            label.Text = "The IncludeListValidator.Candidates list is 'null,2,3,4,5', input 1 in edit mode, then move 
CurrentCell to another Cell to trigger validation (DoActionReason is CellValidating), an error icon pops up to notify you 
validation failed.";
        }
Private Sub setIncludeListValidator_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setIncludeListValidator.Click
        Dim template As Template = template.CreateGridTemplate(1)

        Dim includeListValidator As New IncludeListValidator()
        includeListValidator.Candidates = New String() {Nothing, "2", "3", "4", "5"}

        Dim iconNotify As New IconNotify()
        iconNotify.IconAlignment = ContentAlignment.MiddleCenter
        iconNotify.IconTip = "The editing value is not within the specified candidate list!"
        'When CurrentCell move to another Cell, the action will be done.
        iconNotify.DoActionReason = ValidateReasons.CellValidating

        includeListValidator.Actions.Add(iconNotify)

        template.Row.Cells(0).Validators.Add(includeListValidator)

        Me.gcMultiRow1.Template = template
        label.Text = "The IncludeListValidator.Candidates list is 'null,2,3,4,5', input 1 in edit mode, then move CurrentCell 
to another Cell to trigger validation (DoActionReason is CellValidating), an error icon pops up to notify you validation 
failed."
    End Sub
Inheritance Hierarchy

System.Object
   GrapeCity.Win.MultiRow.CellValidateAction
      GrapeCity.Win.MultiRow.AppearanceActionBase
         GrapeCity.Win.MultiRow.IconNotify

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

IconNotify Members
GrapeCity.Win.MultiRow Namespace
CellValidateAction Class

 

 


Copyright © GrapeCity, inc. All rights reserved.