menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class GridCellValidateValueInfo - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class GridCellValidateValueInfo

    Defines the class that provides a GridStyleInfoSubObject object for validation of text entry in a cell.

    Each property in this sub object can be configured individually. Properties that have not been initialized will inherit default values from a base style.

    Inheritance
    System.Object
    ShouldSerializeBasedPersisterType
    StyleInfoBase
    StyleInfoSubObjectBase
    GridStyleInfoSubObject
    GridCellValidateValueInfo
    Implements
    System.ComponentModel.ICustomTypeDescriptor
    System.IDisposable
    IStyleInfo
    System.ComponentModel.ISupportInitialize
    System.IFormattable
    System.IConvertible
    System.Xml.Serialization.IXmlSerializable
    IStyleInfoSubObject
    Inherited Members
    GridStyleInfoSubObject.GetActiveGridView()
    GridStyleInfoSubObject.GetCellIdentity()
    GridStyleInfoSubObject.GetGridModel()
    GridStyleInfoSubObject.GetGridStyleInfo()
    GridStyleInfoSubObject.Info
    GridStyleInfoSubObject.ToString()
    ShouldSerializeBasedPersisterType.AddNewAttributes(PropertyDescriptor, Attribute[], Int32)
    ShouldSerializeBasedPersisterType.CheckAllProperties
    ShouldSerializeBasedPersisterType.GetCustomPDC(PropertyDescriptorCollection)
    ShouldSerializeBasedPersisterType.GetNewAttributesCount(PropertyDescriptor)
    StyleInfoBase.BeginInit()
    StyleInfoBase.BeginUpdate()
    StyleInfoBase.CacheValues
    StyleInfoBase.Changed
    StyleInfoBase.Changing
    StyleInfoBase.ClearCache()
    StyleInfoBase.CopyFrom(IStyleInfo)
    StyleInfoBase.CreateSubObjectIdentity(StyleInfoProperty)
    StyleInfoBase.Dispose()
    StyleInfoBase.EndInit()
    StyleInfoBase.EndUpdate()
    StyleInfoBase.Equals(Object)
    StyleInfoBase.EqualsObject(Object, Object)
    StyleInfoBase.GetDefaultStyleInfoStore(StyleInfoProperty)
    StyleInfoBase.GetDefaultValue(StyleInfoProperty)
    StyleInfoBase.GetHashCode()
    StyleInfoBase.GetShortValue(StyleInfoProperty)
    StyleInfoBase.GetValue(StyleInfoProperty)
    StyleInfoBase.HasValue(StyleInfoProperty)
    StyleInfoBase.IConvertible.GetTypeCode()
    StyleInfoBase.IConvertible.ToBoolean(IFormatProvider)
    StyleInfoBase.IConvertible.ToByte(IFormatProvider)
    StyleInfoBase.IConvertible.ToChar(IFormatProvider)
    StyleInfoBase.IConvertible.ToDateTime(IFormatProvider)
    StyleInfoBase.IConvertible.ToDecimal(IFormatProvider)
    StyleInfoBase.IConvertible.ToDouble(IFormatProvider)
    StyleInfoBase.IConvertible.ToInt16(IFormatProvider)
    StyleInfoBase.IConvertible.ToInt32(IFormatProvider)
    StyleInfoBase.IConvertible.ToInt64(IFormatProvider)
    StyleInfoBase.IConvertible.ToSByte(IFormatProvider)
    StyleInfoBase.IConvertible.ToSingle(IFormatProvider)
    StyleInfoBase.IConvertible.ToString(IFormatProvider)
    StyleInfoBase.IConvertible.ToType(Type, IFormatProvider)
    StyleInfoBase.IConvertible.ToUInt16(IFormatProvider)
    StyleInfoBase.IConvertible.ToUInt32(IFormatProvider)
    StyleInfoBase.IConvertible.ToUInt64(IFormatProvider)
    StyleInfoBase.Identity
    StyleInfoBase.InheritStyle(IStyleInfo, StyleModifyType)
    StyleInfoBase.IsChanged
    StyleInfoBase.IsEmpty
    StyleInfoBase.IsSubset(IStyleInfo)
    StyleInfoBase.IsValueModified(StyleInfoProperty)
    StyleInfoBase.MergeStyle(IStyleInfo)
    StyleInfoBase.ModifyStyle(IStyleInfo, StyleModifyType)
    StyleInfoBase.OnStyleChanging(StyleInfoProperty)
    StyleInfoBase.ParseString(String)
    StyleInfoBase.ReadXml(XmlReader)
    StyleInfoBase.ResetValue(StyleInfoProperty)
    StyleInfoBase.SetStore(StyleInfoStore)
    StyleInfoBase.SetValue(StyleInfoProperty, Int16)
    StyleInfoBase.SetValue(StyleInfoProperty, Object)
    StyleInfoBase.Store
    StyleInfoBase.ToString(String)
    StyleInfoBase.ToString(String, IFormatProvider)
    StyleInfoBase.Updating
    StyleInfoBase.WeakReferenceChangedListeners
    StyleInfoBase.WriteXml(XmlWriter)
    StyleInfoSubObjectBase.Data
    StyleInfoSubObjectBase.Dispose(Boolean)
    StyleInfoSubObjectBase.IntGetDefaultStyleInfo(StyleInfoProperty)
    StyleInfoSubObjectBase.OnStyleChanged(StyleInfoProperty)
    StyleInfoSubObjectBase.Owner
    StyleInfoSubObjectBase.Sip
    StyleInfoSubObjectBase.SubObjectIdentity
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Syncfusion.Windows.Forms.Grid
    Assembly: Syncfusion.Grid.Windows.dll
    Syntax
    public class GridCellValidateValueInfo : GridStyleInfoSubObject, ICustomTypeDescriptor, IDisposable, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject
    Examples

    The following code changes validation information for cells:

                model[rowIndex, 1].Text = "Positive numbers";
                RowStyles[rowIndex].CustomStyleProperties.Add(new GridValidateNumberStyleProperty(true, 1, float.NaN, "Please enter a number greater than 0!"));
                model.RowStyles[rowIndex].ValidateValue.NumberRequired = true;
                model.RowStyles[rowIndex].ValidateValue.Minimum = 0;
                model.RowStyles[rowIndex].ValidateValue.Maximum = float.NaN;
                model.RowStyles[rowIndex].ValidateValue.ErrorMessage = "Please enter a number greater than 0!";
                rowIndex++;
                model[rowIndex, 1].Text = "Validation (1-100 valid range)";
                model.RowStyles[rowIndex].ValidateValue = new GridCellValidateValueInfo(true, 1, 100, "Please enter a number between 1 and 100!");

    Constructors

    GridCellValidateValueInfo()

    Initializes a new instance of the GridCellValidateValueInfo class.

    Declaration
    public GridCellValidateValueInfo()

    GridCellValidateValueInfo(StyleInfoSubObjectIdentity)

    Initializes a new GridCellValidateValueInfo object and associates it with an existing GridStyleInfoSubObjectIdentity.

    Declaration
    public GridCellValidateValueInfo(StyleInfoSubObjectIdentity identity)
    Parameters
    Type Name Description
    StyleInfoSubObjectIdentity identity

    A GridStyleInfoSubObjectIdentity that holds the identity for this GridCellValidateValueInfo.

    GridCellValidateValueInfo(StyleInfoSubObjectIdentity, GridCellValidateValueInfoStore)

    Initializes a new GridCellValidateValueInfo object and associates it with an existing GridStyleInfoSubObjectIdentity.

    Declaration
    public GridCellValidateValueInfo(StyleInfoSubObjectIdentity identity, GridCellValidateValueInfoStore store)
    Parameters
    Type Name Description
    StyleInfoSubObjectIdentity identity

    A GridStyleInfoSubObjectIdentity that holds the identity for this GridCellValidateValueInfo.

    GridCellValidateValueInfoStore store

    A GridCellValidateValueInfoStore that holds data for this GridCellValidateValueInfo. All changes in this style object will saved in the GridCellValidateValueInfoStore object.

    GridCellValidateValueInfo(Boolean, Double, Double, String)

    Initializes a new instance of the GridCellValidateValueInfo class with specified validating criteria.

    Declaration
    public GridCellValidateValueInfo(bool numberRequired, double minimum, double maximum, string errorMessage)
    Parameters
    Type Name Description
    System.Boolean numberRequired

    IfTrueOnly number is allowed; Otherwise Falsefor any other characters.

    System.Double minimum

    The minimum value allowed for the cell.

    System.Double maximum

    The maximum value allowed for the cell.

    System.String errorMessage

    A error message to be displayed if entered text does not meet criteria.

    Properties

    Default

    Gets a default value ofGridCellValidateValueInfo to be used with a default style.

    Declaration
    public static GridCellValidateValueInfo Default { get; }
    Property Value
    Type
    GridCellValidateValueInfo
    Remarks

    The Default of the GridStyleInfo class will return the validation info that this method generates through its overridden version of GetDefaultStyle().

    Default settings are:

    PropertyValue.
    NumberRequiredFalse.
    MinimumDouble.MinValue.
    MaximumDouble.MaxValue.
    ErrorMessage"Value is out of range".

    ErrorMessage

    Gets or sets the Error message value allowed for the cell.

    Declaration
    public string ErrorMessage { get; set; }
    Property Value
    Type
    System.String

    HasErrorMessage

    Gets a value indicating whether ErrorMessage property is initialized.

    Declaration
    public bool HasErrorMessage { get; }
    Property Value
    Type
    System.Boolean

    HasMaximum

    Gets a value indicating whether Maximum property is initialized.

    Declaration
    public bool HasMaximum { get; }
    Property Value
    Type
    System.Boolean

    HasMinimum

    Gets a value indicating whether Minimum property is initialized.

    Declaration
    public bool HasMinimum { get; }
    Property Value
    Type
    System.Boolean

    HasNumberRequired

    Gets a value indicating whether NumberRequired property is initialized.

    Declaration
    public bool HasNumberRequired { get; }
    Property Value
    Type
    System.Boolean

    Maximum

    Gets or sets the maximum value allowed for the cell.

    Declaration
    public double Maximum { get; set; }
    Property Value
    Type
    System.Double

    Minimum

    Gets or sets the minimum value allowed for the cell.

    Declaration
    public double Minimum { get; set; }
    Property Value
    Type
    System.Double

    NumberRequired

    Gets or sets a value indicating whether numeric entry is allowed. True if only numeric entry is allowed; false if any characters are allowed.

    Declaration
    public bool NumberRequired { get; set; }
    Property Value
    Type Description
    System.Boolean

    IfTrueOnly numbers are allowed;Otherwise Falsefor any other characters.

    Methods

    GetDefaultStyle()

    Overrides and returns the Default

    Declaration
    protected override StyleInfoBase GetDefaultStyle()
    Returns
    Type Description
    StyleInfoBase

    A GridCellValidateValueInfo object with default values.

    Overrides
    StyleInfoBase.GetDefaultStyle()

    MakeCopy(StyleInfoBase, StyleInfoProperty)

    Makes an exact copy of the current object.

    Declaration
    public override IStyleInfoSubObject MakeCopy(StyleInfoBase newOwner, StyleInfoProperty sip)
    Parameters
    Type Name Description
    StyleInfoBase newOwner

    The new owner style object for the copied object.

    StyleInfoProperty sip

    Identifier for this object.

    Returns
    Type Description
    IStyleInfoSubObject

    Copy of current object.

    Overrides
    StyleInfoSubObjectBase.MakeCopy(StyleInfoBase, StyleInfoProperty)

    ResetErrorMessage()

    Resets the ErrorMessage property.

    Declaration
    public void ResetErrorMessage()

    ResetMaximum()

    Resets the Maximum property.

    Declaration
    public void ResetMaximum()

    ResetMinimum()

    Resets the Minimum property.

    Declaration
    public void ResetMinimum()

    ResetNumberRequired()

    Resets the NumberRequired property.

    Declaration
    public void ResetNumberRequired()

    Implements

    System.ComponentModel.ICustomTypeDescriptor
    System.IDisposable
    IStyleInfo
    System.ComponentModel.ISupportInitialize
    System.IFormattable
    System.IConvertible
    System.Xml.Serialization.IXmlSerializable
    IStyleInfoSubObject
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved