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

Defines the fluent API for configuring the SpreadsheetSheetRowCellValidationSettings settings.

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder(SpreadsheetSheetRowCellValidationSettings settings)
Parameters:settingsSpreadsheetSheetRowCellValidationSettings

Methods

Specifies whether to allow null values.

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

The value that configures the allownulls.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.The supported values are: greaterThan; lessThan; between; equalTo; notEqualTo; greaterThanOrEqualTo; lessThanOrEqualTo; notBetween or custom.

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

The value that configures the comparertype.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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 that configures the datatype.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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 that configures the from.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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 that configures the messagetemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.MessageTemplate("The name should be longer than 3 letters and shorter than 200."));
});
});
})
)

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

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 value)
Parameters:valuestring

The value that configures the messagetemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.MessageTemplateHandler("templateHandler"));
});
});
})
)

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 value)
Parameters:valuestring

The value that configures the messagetemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.MessageTemplateId("messageTemplate1"));
});
});
})
)

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(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the messagetemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.MessageTemplateView(Html.Partial("SpreadsheetTemplateView")));
});
});
})
)

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 that configures the showbutton.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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 that configures the titletemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.TitleTemplate("Full Name validation error"));
});
});
})
)

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

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

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

The value that configures the titletemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.TitleTemplateHandler("titleTemplateHandler"));
});
});
})
)

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

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

The value that configures the titletemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.TitleTemplateId("titleTemplate1"));
});
});
})
)

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

C#
public SpreadsheetSheetRowCellValidationSettingsBuilder TitleTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the titletemplate.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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.TitleTemplateView(Html.Partial("TitleTemplateView")));
});
});
})
)

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 that configures the to.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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 that configures the type.

Returns:

SpreadsheetSheetRowCellValidationSettingsBuilder

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"));
});
});
})
)