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

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

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class FlatColorPickerBuilder : WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>, IHtmlString

Inheritance: objectWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>FlatColorPickerBuilder

Implements: IHtmlString

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

C#
public FlatColorPickerBuilder(FlatColorPicker component)
Parameters:componentFlatColorPicker

The component.

Methods

Specifies whether the UI must be updated while the user is typing in the input field, whenever a valid color can be parsed. If the Autoupdate() option is disabled, the FlatColorPicker will be updated only when ENTER is pressed.

C#
public FlatColorPickerBuilder Autoupdate(bool value)
Parameters:valuebool

The value that configures the auto-update option.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Autoupdate(true)
)

Specifies whether the Apply / Cancel buttons must be displayed.

C#
public FlatColorPickerBuilder Buttons(bool value)
Parameters:valuebool

The value that configures the visibility of the buttons.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Buttons(true)
)

Specifies the template which is used for rendering the action buttons.

C#
public FlatColorPickerBuilder ButtonsTemplate(string value)
Parameters:valuestring

The value that configures the buttonstemplate.

Returns:

FlatColorPickerBuilder

Specifies the template which is used for rendering the action buttons.

C#
public FlatColorPickerBuilder ButtonsTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the buttonstemplate.

Returns:

FlatColorPickerBuilder

Specifies the template which is used for rendering the action buttons.

C#
public FlatColorPickerBuilder ButtonsTemplateHandler(string value)
Parameters:valuestring

The value that configures the buttonstemplate.

Returns:

FlatColorPickerBuilder

Specifies the template which is used for rendering the action buttons.

C#
public FlatColorPickerBuilder ButtonsTemplateId(string value)
Parameters:valuestring

The value that configures the buttonstemplate.

Returns:

FlatColorPickerBuilder

Specifies the template which is used for rendering the action buttons.

C#
public FlatColorPickerBuilder ButtonsTemplateView(MvcHtmlString value)
Parameters:valueMvcHtmlString

The value that configures the buttonstemplate.

Returns:

FlatColorPickerBuilder

Specifies whether the 'Clear color' button must be displayed.

C#
public FlatColorPickerBuilder ClearButton(bool value)
Parameters:valuebool

The value that configures the visibility of the button.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.ClearButton(true)
)

Sets the number of columns to show in the palette. Also, defines the width of the FlatColorPicker.

C#
public FlatColorPickerBuilder Columns(double value)
Parameters:valuedouble

The value that configures the number of the columns.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Columns(4)
)

Enables the contrast tool of the FlatColorPicker.

C#
public FlatColorPickerBuilder ContrastTool()
Returns:

FlatColorPickerBuilder

Defines the contrast tool options.

C#
public FlatColorPickerBuilder ContrastTool(Action<FlatColorPickerContrastToolSettingsBuilder> configurator)
Parameters:configuratorAction<FlatColorPickerContrastToolSettingsBuilder>

The action that configures the contrast tool settings.

Returns:

FlatColorPickerBuilder

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

Enables the contrast tool of the FlatColorPicker.

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

Toggles the visibility of the contrast tool.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.ContrastTool(true)
)

Configures the handled client-side events of the FlatColorPicker.

C#
public FlatColorPickerBuilder Events(Action<FlatColorPickerEventBuilder> configurator)
Parameters:configuratorAction<FlatColorPickerEventBuilder>

The action that configures the available events.

Returns:

FlatColorPickerBuilder

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

Sets the default input format in the gradient input editor. The valid formats are "rgb" and "hex".

C#
public FlatColorPickerBuilder Format(string value)
Parameters:valuestring

The value that configures the format.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Format("rgb")
)

Sets the available input formats in the gradient input editor. Only "hex" and "rgb" are valid values.

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

A list of formats.

Returns:

FlatColorPickerBuilder

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

Specifies whether the input must be displayed in the FlatColorPicker.

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

The value that configures the visibility of the input.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Input(true)
)

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

C#
public FlatColorPickerBuilder Messages(Action<FlatColorPickerMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<FlatColorPickerMessagesSettingsBuilder>

The action that configures the message settings.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Messages(msg =&gt; msg.Apply("Set"))
)

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

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

The value that configures the visibility of the opacity slider.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Opacity(true)
)

Sets the color palette the user can pick from.

C#
public FlatColorPickerBuilder Palette(ColorPickerPalette palette)
Parameters:paletteColorPickerPalette

The enum value that configures the color palette.

Returns:

FlatColorPickerBuilder

Example:
C#
@( Html.Kendo().FlatColorPicker()
.Name("FlatColorPicker")
.Palette(ColorPickerPalette.WebSafe)
)

Sets the range of colors that the user can pick from.

C#
public FlatColorPickerBuilder Palette(IEnumerable<string> palette)
Parameters:paletteIEnumerable<string>

A list of colors.

Returns:

FlatColorPickerBuilder

Example:
C#
@( Html.Kendo().FlatColorPicker()
.Name("FlatColorPicker")
.Palette(new List&lt;string&gt; { "#ff0000", "#00ff00", "#0000ff" })
)

Specifies whether a selected and previous colors are displayed for color comparison. When the Autoupdate() option is enabled, both selected and previous colors will be updated.

C#
public FlatColorPickerBuilder Preview(bool value)
Parameters:valuebool

The value that configures the preview option.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Preview(true)
)

Sets the size of the component.

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

The value that configures the size.

Returns:

FlatColorPickerBuilder

Specifies the initially selected color.

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

The value that configures the initial color.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.Value("#b72bba")
)

Defines the initially selected view in the FlatColorPicker. The valid views are "gradient" and "palette".

C#
public FlatColorPickerBuilder View(string value)
Parameters:valuestring

The value that configures the initial view.

Returns:

FlatColorPickerBuilder

Example:
C#
@(Html.Kendo().FlatColorPicker()
.Name("flatColorPicker")
.View("palette")
)

Sets the available views in the FlatColorPicker. The valid values are "gradient" and "palette".

C#
public FlatColorPickerBuilder Views(params string[] views)
Parameters:viewsstring[]

A list of the views.

Returns:

FlatColorPickerBuilder

Example:
C#
@( Html.Kendo().FlatColorPicker()
.Name("FlatColorPicker")
.Views(new string[]{ "gradient", "palette" })
)