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

Defines the fluent interface for building TreeViewBindingSettingsBuilder

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class TreeViewBindingSettingsBuilder

Inheritance: objectTreeViewBindingSettingsBuilder

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

Constructors

Initializes a new instance of the TreeViewBindingSettingsBuilder class.

C#
public TreeViewBindingSettingsBuilder(TreeViewBindingSettings settings)
Parameters:settingsTreeViewBindingSettings

The settings.

Methods

Enables or disables binding.

C#
public TreeViewBindingSettingsBuilder Enabled(bool value)
Parameters:valueboolReturns:

TreeViewBindingSettingsBuilder

The Enabled method is useful when you need to enable binding based on certain conditions.

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Index", "Home").Enabled((bool)ViewData["ajax"]);
})
)

Sets the action, controller and route values

C#
public TreeViewBindingSettingsBuilder Select(RouteValueDictionary routeValues)
Parameters:routeValuesRouteValueDictionary

The route values of the Action method.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().Grid(Model)
.Name("Grid")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select(MVC.Home.Index(1).GetRouteValueDictionary());
})
)

Sets the route and values for the select operation

C#
public TreeViewBindingSettingsBuilder Select(string routeName, object routeValues)
Parameters:routeNamestring

Name of the route.

routeValuesobject

The route values.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Default", new {id=1});
})
)

Sets the route and values for the select operation

C#
public TreeViewBindingSettingsBuilder Select(string routeName, RouteValueDictionary routeValues)
Parameters:routeNamestring

Name of the route.

routeValuesRouteValueDictionary

The route values.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Default", "Home", new RouteValueDictionary{ {"id", 1} });
})
)

Sets the action, controller and route values for the select operation

C#
public TreeViewBindingSettingsBuilder Select(string actionName, string controllerName, object routeValues)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

routeValuesobject

The route values.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Index", "Home", new { {"id", 1} });
})
)

Sets the action, controller and route values for the select operation

C#
public TreeViewBindingSettingsBuilder Select(string actionName, string controllerName, RouteValueDictionary routeValues)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

routeValuesRouteValueDictionary

The route values.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Index", "Home", new RouteValueDictionary{ {"id", 1} });
})
)

Sets the action, controller and route values for the select operation

C#
public TreeViewBindingSettingsBuilder Select(string actionName, string controllerName)
Parameters:actionNamestring

Name of the action.

controllerNamestring

Name of the controller.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Index", "Home");
})
)

Sets the route name for the select operation

C#
public TreeViewBindingSettingsBuilder Select(string routeName)
Parameters:routeNamestring

Name of the route.

Returns:

TreeViewBindingSettingsBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.DataBinding(dataBinding =>
{
dataBinding.Ajax().Select("Default");
})
)