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

Defines the fluent API for configuring FilterField

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Type Parameters:

T

Syntax:

C#
public class FilterFieldBuilder<T> where T : class

Inheritance: objectFilterFieldBuilder<T>

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

Constructors

FilterFieldBuilder method.

C#
public FilterFieldBuilder(FilterField<T> container)
Parameters:containerFilterField<T>

Properties

Gets or sets the Container.

C#
protected FilterField<T> Container { get; }

Methods

A value which will be initially set as a filter value when an expression item for the specific field is created.

C#
public FilterFieldBuilder<T> DefaultValue(object value)
Parameters:valueobject

The value for DefaultValue

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

The template which the widget will use to create the field editor.

C#
public FilterFieldBuilder<T> EditorTemplate(string value)
Parameters:valuestring

The value for EditorTemplate

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

The template which the widget will use to create the field editor.

C#
public FilterFieldBuilder<T> EditorTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the editortemplate.

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

The template which the widget will use to create the field editor.

C#
public FilterFieldBuilder<T> EditorTemplateHandler(Func<object, object> value)
Parameters:valueFunc<object, object>

The value for EditorTemplate

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

Example:
C#
@(Html.Kendo().Filter&lt;ProductViewModel&gt;()
.Name("filter")
.Fields(fields =&gt;
{
fields.Add(field =&gt; field.ProductName)
.Label("ProductName")
.EditorTemplateHandler(@&lt;text&gt;
function editorTemplateHandler(e){
editor template handling code
}
&lt;/text&gt;);
})
)

The template which the widget will use to create the field editor.

C#
public FilterFieldBuilder<T> EditorTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for EditorTemplate

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

The template which the widget will use to create the field editor.

C#
public FilterFieldBuilder<T> EditorTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for EditorTemplate

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

The template which the widget will use to create the field editor.

C#
public FilterFieldBuilder<T> EditorTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for EditorTemplate

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

Defines a value which will be visualized instead of the data feild name.

C#
public FilterFieldBuilder<T> Label(string value)
Parameters:valuestring

The value for Label

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

The text of the filter operators displayed in the filter.

C#
public FilterFieldBuilder<T> Operators(Action<FilterOperatorsSettingsBuilder<T>> configurator)
Parameters:configuratorAction<FilterOperatorsSettingsBuilder<T>>

The configurator for the operators setting.

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.

Example:
C#
@(Html.Kendo().Filter&lt;ProductViewModel&gt;()
.Name("filter")
.Fields(fields =&gt;
{
fields.Add(product =&gt; product.ProductName)
.Label("ProductName")
.Operators(operators =&gt;
{
operators.String(s =&gt;
{
s.Contains("Contains")
.Startswith("Starts with")
.Endswith("Ends with")
.Eq("Equals")
.Neq("Does not equal")
.Isnull("Is null")
.Isnotnull("Is not null")
.Isnotempty("Is not empty")
.Isnullorempty("Is null or empty")
.Isnotnullorempty("Is not null or empty")
.Contains("Contains")
.Doesnotcontain("Does not contain");
});
});
})
)

The format of the value displayed in the preview.

C#
public FilterFieldBuilder<T> PreviewFormat(string value)
Parameters:valuestring

The value for PreviewFormat

Returns:

FilterFieldBuilder<T>

Returns the current FilterFieldBuilder<T> instance.