FilterFieldBuilder
Methods
EditorTemplate(System.String)
The template which the widget will use to create the field editor.
Parameters
value - System.String
The value that configures the editortemplate.
EditorTemplateId(System.String)
The template which the widget will use to create the field editor.
Parameters
value - System.String
The value that configures the editortemplate.
EditorTemplateView(System.Web.Mvc.MvcHtmlString)
The template which the widget will use to create the field editor.
Parameters
value - System.Web.Mvc.MvcHtmlString
The value that configures the editortemplate.
Label(System.String)
Defines a value which will be visualized instead of the data feild name.
Parameters
value - System.String
The value that configures the label.
DefaultValue(System.Object)
A value which will be initially set as a filter value when an expression item for the specific field is created.
Parameters
value - System.Object
The value for DefaultValue
Example
@(Html.Kendo().Filter<ProductViewModel>()
.Name("filter")
.Fields(fields =>
{
fields.Add(field => field.ProductName)
.DefaultValue("Chai");
})
)
EditorTemplateHandler(System.String)
The template which the widget will use to create the field editor.
Parameters
value - System.String
The value for EditorTemplate
Example
@(Html.Kendo().Filter<ProductViewModel>()
.Name("filter")
.Fields(fields =>
{
fields.Add(field => field.ProductName)
.EditorTemplateHandler("editorTemplateHandler");
})
)
EditorTemplateHandler(System.Func)
The template which the widget will use to create the field editor.
Parameters
value - System.Func<Object,Object>
The value for EditorTemplate
Example
@(Html.Kendo().Filter<ProductViewModel>()
.Name("filter")
.Fields(fields =>
{
fields.Add(product => product.ProductName)
.EditorTemplateHandler(@<text>
function editorTemplateHandler(e){
editor template handling code
}
</text>);
})
)
Operators(System.Action)
The text of the filter operators displayed in the filter.
Parameters
configurator - System.Action<FilterOperatorsSettingsBuilder>
The configurator for the operators setting.
Example
@(Html.Kendo().Filter<ProductViewModel>()
.Name("filter")
.Fields(fields =>
{
fields.Add(product => product.ProductName)
.Label("ProductName")
.Operators(operators =>
{
operators.String(s =>
{
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");
});
});
})
)
PreviewFormat(System.String)
Sets the format of the value in the preview.
Parameters
value - System.String
The format.
Example
@(Html.Kendo().Filter<ProductViewModel>()
.Name("filter")
.Fields(fields =>
{
fields.Add(field => field.UnitPrice)
.PreviewFormat("n2");
})
)