GrapeCity.Win.MultiRow Namespace > ValidateContext Class : ValidateInfo Property |
<DefaultValueAttribute()> Public Property ValidateInfo As String
Dim instance As ValidateContext Dim value As String instance.ValidateInfo = value value = instance.ValidateInfo
[DefaultValue()] public string ValidateInfo {get; set;}
class MyRequiredFieldValidator : RequiredFieldValidator { protected override bool Validate(ValidateContext context) { if (context.EditedFormattedValue != null) { string value = context.EditedFormattedValue.ToString(); if (value != "NULL") { context.ValidateInfo = "The input value is not NULL"; return false; } else { return true; } } return base.Validate(context); } }
Private Class MyRequiredFieldValidator Inherits RequiredFieldValidator Protected Overloads Overrides Function Validate(ByVal context As ValidateContext) As Boolean If context.EditedFormattedValue <> Nothing Then Dim value As String = context.EditedFormattedValue.ToString() If value <> "NULL" Then context.ValidateInfo = "The input value is not NULL" Return False Else Return True End If End If Return MyBase.Validate(context) End Function End Class
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