New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI validation TagHelper SpreadsheetSheetRowCellValidationSettingsTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("validation", ParentTag = "cell", TagStructure = TagStructure.WithoutEndTag)]
[SuppressTagRendering]
public class SpreadsheetSheetRowCellValidationSettingsTagHelper : TagHelperChildBase, ITagHelper, ITagHelperComponent, ITemplateComponent

Inheritance: objectTagHelperTagHelperChildBaseSpreadsheetSheetRowCellValidationSettingsTagHelper

Implements: ITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperChildBase.Init(TagHelperContext)TagHelperChildBase.AddSelfToContext(TagHelperContext)TagHelperChildBase.CreateHandler(string)TagHelperChildBase.IdPrefixTagHelper.Process(TagHelperContext, TagHelperOutput)TagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc
@{

    string[] mergedCells = new string[] { "A1:E1" };

	var from_1 = "AND(LEN(A3)>3, LEN(A3)<200)";
	var from_4 = "AND(ISNUMBER(D3),LEN(D3)<14)";
	var to = @"DATEVALUE(""1/1/1998"")";

}
<kendo-spreadsheet name="spreadsheet">
    <sheets>
        <sheet>
            <rows>
                <sheet-row>
                    <cells>
                        <cell>
                            <validation type="reject" datatype="custom" from="@from_4" allow-nulls="true" message-template="The value entered is not an valid phone number. Please enter numeric value with less than 14 digits." title-template="Phone validation error" />
                        </cell>
                    </cells>
                </sheet-row>
            </rows>
        </sheet>
    </sheets>
</kendo-spreadsheet>

Constructors

Initializes a new instance of the SpreadsheetSheetRowCellValidationSettingsTagHelper class.

C#
public SpreadsheetSheetRowCellValidationSettingsTagHelper()

Properties

Specifies whether to allow null values.

C#
public bool? AllowNulls { get; set; }

Defines the comparer type that is used to validate the cell value.

C#
public string ComparerType { get; set; }

Defines the data type of the cell value.

C#
[HtmlAttributeName("datatype")]
public string DataType { get; set; }

Defines a formula or a value that is used for the comparison process. Used as the only compare value if the comparer type does not require a second argument. Mandatory for validation to work.

C#
public string From { get; set; }

Defines the hint message that will be displayed if the value is invalid.The template provides access to the following variables: from{0}; to{1}; fromFormula{2}; toFormula{3}; dataType{4}; type{5} or comparerType{6}.

C#
public string MessageTemplate { get; set; }

Defines the hint message that will be displayed if the value is invalid.The template provides access to the following variables: from{0}; to{1}; fromFormula{2}; toFormula{3}; dataType{4}; type{5} or comparerType{6}. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string MessageTemplateHandler { get; set; }

Defines the hint message that will be displayed if the value is invalid.The template provides access to the following variables: from{0}; to{1}; fromFormula{2}; toFormula{3}; dataType{4}; type{5} or comparerType{6}. This option expects the ID of the script element that contains the template.

C#
public string MessageTemplateId { get; set; }

Defines the hint message that will be displayed if the value is invalid.The template provides access to the following variables: from{0}; to{1}; fromFormula{2}; toFormula{3}; dataType{4}; type{5} or comparerType{6}. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent MessageTemplateView { get; set; }

A Boolean value which indicates if a button for selecting list items will be displayed (dataType set to list).

C#
public bool? ShowButton { get; set; }

Configures the templates for the SpreadsheetSheetRowCellValidationSettings.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

Defines the hint title that will be displayed if the value is invalid.

C#
public string TitleTemplate { get; set; }

Defines the hint title that will be displayed if the value is invalid. This option expects the name of a JavaScript function that will be called to return the template.

C#
public string TitleTemplateHandler { get; set; }

Defines the hint title that will be displayed if the value is invalid. This option expects the ID of the script element that contains the template.

C#
public string TitleTemplateId { get; set; }

Defines the hint title that will be displayed if the value is invalid. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent TitleTemplateView { get; set; }

Defines a formula or a value that is used for the comparison process. Will be used if the comparer type requires a second argument.

C#
public string To { get; set; }

Defines the validation type.The supported options are: reject or warning (default).

C#
public string Type { get; set; }

Methods

Adds the current TagHelper instance to its parent TagHelper.

C#
protected override void AddSelfToParent(TagHelperContext context)
Parameters:contextTagHelperContext

The TagHelper context.

Overrides: TagHelperChildBase.AddSelfToParent(TagHelperContext)

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelperChildBase.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public Dictionary<string, object> Serialize()
Returns:

Dictionary<string, object>

Serializes the defined templates.

C#
public Dictionary<string, object> SerializeTemplates()
Returns:

Dictionary<string, object>