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

Extension methods for IWidget.

Definition

Namespace:Kendo.Mvc.Extensions

Assembly:Kendo.Mvc.dll

Syntax:

C#
public static class WidgetExtensions

Inheritance: objectWidgetExtensions

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

Methods

Gets the formatted value for a widget from various sources (model state, ViewData, or the provided value) with custom formatting.

C#
public static string GetValue<T>(this IWidget instance, string name, T value, string format = "{0}")
Parameters:instanceIWidget

The widget instance.

namestring

The name of the field to retrieve the value for.

valueT

The value to use if no other source provides a value.

formatstring

The format string to apply to the value (default is "{0}").

Returns:

string

The formatted string value.

Gets the formatted value for a widget from various sources (model state, ViewData, or the provided value).

C#
public static string GetValue<T>(this IWidget instance, T value)
Parameters:instanceIWidget

The widget instance.

valueT

The value to use if no other source provides a value.

Returns:

string

The formatted string value.