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

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

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class FlatColorPickerBuilder : MvvmWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>, IHtmlContent

Inheritance: objectHelperResultWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>MvvmWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>FlatColorPickerBuilder

Implements: IHtmlContent

Inherited Members MvvmWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.UseMvvmInitialization(bool)MvvmWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.UseMvvmInitialization()WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ToComponent()WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.Expression(string)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.Explorer(ModelExplorer)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.Name(string)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.Deferred(bool)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.HtmlAttributes(object)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.Render()WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ToHtmlString()WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.WriteTo(TextWriter, HtmlEncoder)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ToClientTemplate()WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.AsModule(bool)WidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ComponentWidgetBuilderBase<FlatColorPicker, FlatColorPickerBuilder>.ContainerHelperResult.WriteTo(TextWriter, HtmlEncoder)HelperResult.WriteActionobject.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 FlatColorPickerBuilder class.

C#
public FlatColorPickerBuilder(FlatColorPicker component)
Parameters:componentFlatColorPicker

Methods

Specifies whether the UI should be updated while the user is typing in the input field, whenever a valid color can be parsed. If you pass false for this, the widget will update only when ENTER is pressed.

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

The value for Autoupdate

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Specifies whether the widget should display the Apply / Cancel buttons.

C#
public FlatColorPickerBuilder Buttons()
Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

Specifies whether the widget should display the Apply / Cancel buttons.

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

The value for Buttons

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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 for ButtonsTemplate

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Returns the current FlatColorPickerBuilder instance.

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

C#
public FlatColorPickerBuilder ButtonsTemplateHandler(string templateHandler)
Parameters:templateHandlerstring

The handler that returs the template for ButtonsTemplate

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

C#
public FlatColorPickerBuilder ButtonsTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ButtonsTemplate

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

C#
public FlatColorPickerBuilder ButtonsTemplateView(IHtmlContent templateView)
Parameters:templateViewIHtmlContent

The view that contains the template for ButtonsTemplate

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

Specifies whether the widget should display the 'Clear color' button.

C#
public FlatColorPickerBuilder ClearButton()
Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

Specifies whether the widget should display the 'Clear color' button.

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

The value for ClearButton

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

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 for Columns

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Enables the contrast tool in the ColorGradient.

C#
public FlatColorPickerBuilder ContrastTool()
Returns:

FlatColorPickerBuilder

Returns the current instance of FlatColorPickerContrastToolSettingsBuilder .

Enables the contrast tool in the ColorGradient.

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

The FlatColorPickerContrastToolSettingsBuilder for the contrasttool setting.

Returns:

FlatColorPickerBuilder

Returns the current instance of FlatColorPickerBuilder .

Enables the contrast tool in the ColorGradient.

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

Enables or disables the contrasttool option.

Returns:

FlatColorPickerBuilder

Returns the current instance of FlatColorPickerContrastToolSettingsBuilder .

Configures the client-side events.

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

The client events action.

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Defines the format of the gradient input editor.

C#
public FlatColorPickerBuilder Format(ColorPickerFormat value)
Parameters:valueColorPickerFormat

The value for Format

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Returns the current FlatColorPickerBuilder instance.

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

Whether to render the input in ColorGradient component.

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

The value for Input

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Allows customization of "Apply" / "Cancel" labels.

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

The FlatColorPickerMessagesSettingsBuilder for the messages setting.

Returns:

FlatColorPickerBuilder

Returns the current instance of FlatColorPickerBuilder .

Specifies whether we should display the opacity slider to allow selection of transparency.

C#
public FlatColorPickerBuilder Opacity()
Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

Specifies whether we should display the opacity slider to allow selection of transparency.

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

The value for Opacity

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Defines the palettes that can be used in the color picker.

C#
public FlatColorPickerBuilder Palette(ColorPickerPalette value)
Parameters:valueColorPickerPalette

The value for Palette

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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(params string[] palette)
Parameters:palettestring[]

A list of colors.

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Specifies whether a selected and previous color are displayed for color comparison. with autoupdate set to true both selected and previous colors will be updated.

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

The value for Preview

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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 for Size

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

Specifies the initially selected color.

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

The value for Value

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

The initially selected view in the FlatColorPicker.

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

The value for View

Returns:

FlatColorPickerBuilder

Returns the current FlatColorPickerBuilder instance.

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

Returns the current FlatColorPickerBuilder instance.

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