GrapeCity.Win.MultiRow Namespace > RangeValidator Class : RequiredType Property |
<RefreshPropertiesAttribute(RefreshProperties.All)> <DefaultValueAttribute()> <TypeConverterAttribute("GrapeCity.Win.MultiRow.Design.RequiredTypeCoverter, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")> <SRDescriptionAttribute("Indicates the specified value's desired type.")> Public Property RequiredType As Type
Dim instance As RangeValidator Dim value As Type instance.RequiredType = value value = instance.RequiredType
[RefreshProperties(RefreshProperties.All)] [DefaultValue()] [TypeConverter("GrapeCity.Win.MultiRow.Design.RequiredTypeCoverter, GrapeCity.Win.MultiRow, Version=7.20.20141.0, Culture=neutral, PublicKeyToken=0f7a722ee3c2bdd9")] [SRDescription("Indicates the specified value's desired type.")] public Type RequiredType {get; set;}
void setRangeValidator_Click(object sender, EventArgs e) { Template template = Template.CreateGridTemplate(1); //Create one RangeValidator to validate whether the committed value is in range. RangeValidator rangValidator = new RangeValidator(); //Set the RequiredType first, then set other Properties. rangValidator.RequiredType = typeof(int); rangValidator.MinValue = 5; rangValidator.MaxValue = 10; rangValidator.NullIsValid = false; LineNotify lineNotifyAction = new LineNotify(); //When you end edit mode, the action is done (press Enter key) lineNotifyAction.DoActionReason = ValidateReasons.EndEdit; lineNotifyAction.LineColor = Color.Red; rangValidator.Actions.Add(lineNotifyAction); template.Row.Cells[0].Validators.Add(rangValidator); this.gcMultiRow1.Template = template; label.Text = "The RangeValidator's MinValue is 5, MaxValue is 10, input 4 (not in the range) in one cell, press Enter key to trigger validation (DoActionReason is EndEdit), a red underline is shown."; }
Private Sub setRangeValidator_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setRangeValidator.Click Dim template As Template = template.CreateGridTemplate(1) 'Create one RangeValidator to validate whether the committed value is in range. Dim rangValidator As New RangeValidator() 'Set the RequiredType first, then set other Properties. rangValidator.RequiredType = GetType(Integer) rangValidator.MinValue = 5 rangValidator.MaxValue = 10 rangValidator.NullIsValid = False Dim lineNotifyAction As New LineNotify() 'When you end edit mode, the action is done (press Enter key) lineNotifyAction.DoActionReason = ValidateReasons.EndEdit lineNotifyAction.LineColor = Color.Red rangValidator.Actions.Add(lineNotifyAction) template.Row.Cells(0).Validators.Add(rangValidator) Me.gcMultiRow1.Template = template label.Text = "The RangeValidator's MinValue is 5, MaxValue is 10, input 4 (not in range) in one cell, press Enter key to trigger validation (DoActionReason is EndEdit), a red underline is shown." End Sub
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