Syncfusion.Grid.Windows


StrictValueType Property

Gets or sets a value indicating whether an exception should be thrown in the ApplyFormattedText(String) method if the formatted text can not be parsed and converted to the type specified with CellValueType.
Syntax
'Declaration
 
<BrowsableAttribute(True)>
<SRCategoryAttribute("StyleCategoryValue")>
<DescriptionAttribute("Gets/sets a value indicating whether an exception should be thrown in the ApplyFormattedText method,if the formatted text can not be parsed and converted to the type specified with CellType")>
<RefreshPropertiesAttribute(RefreshProperties.Repaint)>
<NotifyParentPropertyAttribute(True)>
Public Property StrictValueType As Boolean
'Usage
 
Dim instance As GridStyleInfo
Dim value As Boolean
 
instance.StrictValueType = value
 
value = instance.StrictValueType
[Browsable(true)]
[SRCategory("StyleCategoryValue")]
[Description("Gets/sets a value indicating whether an exception should be thrown in the ApplyFormattedText method,if the formatted text can not be parsed and converted to the type specified with CellType")]
[RefreshProperties(RefreshProperties.Repaint)]
[NotifyParentProperty(true)]
public bool StrictValueType {get; set;}
Remarks
The ApplyFormattedText(String) method will be called when the user enters text into a text box. The method checks if there are event handlers for SaveCellFormattedText. If not, it will continue with its default behavior and try to convert the input text into the type specified with CellValueType.

If this conversion fails, ApplyFormattedText(String) will check StrictValueType. If it is True, an exception is thrown which itself results in a warning message displayed to the user at the time from GridControlBase.CurrentCellValidating.

If you set StrictValueType to False, ApplyFormattedText(String) will not throw an exception; it will simply store the text as CellValue.

If you need a more specialized customization of this behavior, you should handle the SaveCellFormattedText event. This lets you parse the text input and change the cell's CellValueType at run-time. See SaveCellFormattedText for an example how to do this.

The default value for the StrictValueType property is True.

The property affects the behavior or appearance of the following cell types:

AssemblyVersion

Syncfusion.Grid.Windows: 17.3460.0.26

See Also