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

Defines the fluent API for configuring the Telerik UI for ASP.NET MVC ColorGradient.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ColorGradientBuilder : WidgetBuilderBase<ColorGradient, ColorGradientBuilder>, IHtmlString

Inheritance: objectWidgetBuilderBase<ColorGradient, ColorGradientBuilder>ColorGradientBuilder

Implements: IHtmlString

Inherited Members WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ToComponent()WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.Name(string)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.Deferred(bool)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ModelMetadata(ModelMetadata)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.HtmlAttributes(object)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.AsModule(bool)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.Render()WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ToHtmlString()WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ToClientTemplate()WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.ToString()WidgetBuilderBase<ColorGradient, ColorGradientBuilder>.Componentobject.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 ColorGradient class.

C#
public ColorGradientBuilder(ColorGradient component)
Parameters:componentColorGradient

The component.

Methods

Enables the contrast tool of the ColorGradient.

C#
public ColorGradientBuilder ContrastTool()
Returns:

ColorGradientBuilder

Defines the contrast tool options.

C#
public ColorGradientBuilder ContrastTool(Action<ColorGradientContrastToolSettingsBuilder> configurator)
Parameters:configuratorAction<ColorGradientContrastToolSettingsBuilder>

The action that configures the contrast tool settings.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.ContrastTool(ct =&gt; ct.BackgroundColor("#ff0000"))
)

Enables the contrast tool of the ColorGradient.

C#
public ColorGradientBuilder ContrastTool(bool enabled)
Parameters:enabledbool

The value that configures the visibility of the contrast tool.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.ContrastTool(true)
)

Configures the handled client-side events of the ColorGradient.

C#
public ColorGradientBuilder Events(Action<ColorGradientEventBuilder> configurator)
Parameters:configuratorAction<ColorGradientEventBuilder>

The action that configures the available events.

Returns:

ColorGradientBuilder

Example:
C#
@( Html.Kendo().ColorGradient()
.Name("ColorGradient")
.Events(events =&gt; events
.Change("onChange")
)
)

Defines the default input format in the gradient input editor.

C#
public ColorGradientBuilder Format(ColorGradientFormat value)
Parameters:valueColorGradientFormat

The value that configures the format.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.Format(ColorGradientFormat.Rgb)
)

Sets the available input formats in the gradient input editor.

C#
public ColorGradientBuilder Formats(params string[] formats)
Parameters:formatsstring[]

Only "hex" and "rgb" are valid values.

Returns:

ColorGradientBuilder

Example:
C#
@( Html.Kendo().ColorGradient()
.Name("ColorGradient")
.Formats(new string[]{ "rgb", "hex" })
)

Toggles the visibility of the input.

C#
public ColorGradientBuilder Input(bool value)
Parameters:valuebool

The value that configures the visibility of the input.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.Input(false)
)

Defines the localization of the texts that are used in the ColorGradient.

C#
public ColorGradientBuilder Messages(Action<ColorGradientMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<ColorGradientMessagesSettingsBuilder>

The action that configures the message settings.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.Messages(msg =&gt; msg.ToggleFormat("Change format"))
)

Specifies whether the opacity slider must be shown to allow transparency selection.

C#
public ColorGradientBuilder Opacity(bool value)
Parameters:valuebool

The value that configures the visibility of the opacity slider.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.Opacity(true)
)

Sets a value controlling the size of the component.

C#
public ColorGradientBuilder Size(ComponentSize value)
Parameters:valueComponentSize

The value that configures the size.

Returns:

ColorGradientBuilder

Specifies the initially selected color.

C#
public ColorGradientBuilder Value(string value)
Parameters:valuestring

The value that configures the initial color.

Returns:

ColorGradientBuilder

Example:
C#
@(Html.Kendo().ColorGradient()
.Name("colorGradient")
.Value("#000")
)