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

Defines the fluent API for configuring SpreadsheetSheetRowCellValidationSettings

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class SpreadsheetSheetRowCellValidationSettingsBuilder

Inheritance: objectSpreadsheetSheetRowCellValidationSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

SpreadsheetSheetRowCellValidationSettingsBuilder method.

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder(SpreadsheetSheetRowCellValidationSettings container)
Parameters:containerSpreadsheetSheetRowCellValidationSettings

Properties

Gets the settings being configured.

C#
protected SpreadsheetSheetRowCellValidationSettings Container { get; }

Methods

Specifies whether to allow null values.

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder AllowNulls(bool value)
Parameters:valuebool

The value for AllowNulls

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =>
{
sheets.Add()
.Name("Food Order")
.Rows(rows =>
{
rows.Add()
.Cells(cells =>
{
cells.Add()
.Value("John Doe")
.Validation(validation => validation.AllowNulls(true));
});
});
})
)

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder ComparerType(string value)
Parameters:valuestring

The value for ComparerType

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =>
{
sheets.Add()
.Name("Food Order")
.Rows(rows =>
{
rows.Add()
.Cells(cells =>
{
cells.Add()
.Value("John Doe")
.Validation(validation => validation.ComparerType("list"));
});
});
})
)

Defines the data type of the cell value.The supported values are: date; text; number; list or custom.

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder DataType(string value)
Parameters:valuestring

The value for DataType

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =>
{
sheets.Add()
.Name("Food Order")
.Rows(rows =>
{
rows.Add()
.Cells(cells =>
{
cells.Add()
.Value("John Doe")
.Validation(validation => validation.DataType("custom"));
});
});
})
)

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 SpreadsheetSheetRowCellValidationSettingsBuilder From(string value)
Parameters:valuestring

The value for From

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =>
{
sheets.Add()
.Name("Food Order")
.Rows(rows =>
{
rows.Add()
.Cells(cells =>
{
cells.Add()
.Value(20000)
.Validation(validation => validation.From("DATEVALUE(\"1/1/1990\")"));
});
});
})
)

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 SpreadsheetSheetRowCellValidationSettingsBuilder MessageTemplate(string value)
Parameters:valuestring

The value for MessageTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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 SpreadsheetSheetRowCellValidationSettingsBuilder MessageTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the messagetemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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 SpreadsheetSheetRowCellValidationSettingsBuilder MessageTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for MessageTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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 SpreadsheetSheetRowCellValidationSettingsBuilder MessageTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for MessageTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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 SpreadsheetSheetRowCellValidationSettingsBuilder MessageTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for MessageTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder ShowButton()
Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder ShowButton(bool value)
Parameters:valuebool

The value for ShowButton

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =&gt;
{
sheets.Add()
.Name("Food Order")
.Rows(rows =&gt;
{
rows.Add()
.Cells(cells =&gt;
{
cells.Add()
.Value("John Doe")
.Validation(validation =&gt; validation.ShowButton(true));
});
});
})
)

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder TitleTemplate(string value)
Parameters:valuestring

The value for TitleTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder TitleTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the titletemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder TitleTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for TitleTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder TitleTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for TitleTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder TitleTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for TitleTemplate

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

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 SpreadsheetSheetRowCellValidationSettingsBuilder To(string value)
Parameters:valuestring

The value for To

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =&gt;
{
sheets.Add()
.Name("Food Order")
.Rows(rows =&gt;
{
rows.Add()
.Cells(cells =&gt;
{
cells.Add()
.Value(20000)
.Validation(validation =&gt; validation.To("DATEVALUE(\"1/1/1998\")"));
});
});
})
)

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder Type(string value)
Parameters:valuestring

The value for Type

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

Returns the current SpreadsheetSheetRowCellValidationSettingsBuilder instance.

Example:
C#
@( Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.Sheets(sheets =&gt;
{
sheets.Add()
.Name("Food Order")
.Rows(rows =&gt;
{
rows.Add()
.Cells(cells =&gt;
{
cells.Add()
.Value("John Doe")
.Validation(validation =&gt; validation.Type("reject"));
});
});
})
)