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

Defines the fluent interface for configuring the DatePickerBase component.

Definition

Constructors

Initializes a new instance of the ColorPickerBuilder class.

C#
public ColorPickerBuilder(ColorPicker component)
Parameters:componentColorPicker

The component.

Methods

Specifies the adaptive rendering of the component. The supported values are: none (default), auto.

C#
public ColorPickerBuilder AdaptiveMode(AdaptiveMode value)
Parameters:valueAdaptiveMode

The value that configures the adaptivemode.

Returns:

ColorPickerBuilder

Allows customization of the subtitle's text in the adaptive view of the component.

C#
public ColorPickerBuilder AdaptiveSubtitle(string value)
Parameters:valuestring

The value that configures the adaptivesubtitle.

Returns:

ColorPickerBuilder

Allows customization of the title's text in the adaptive view of the component.

C#
public ColorPickerBuilder AdaptiveTitle(string value)
Parameters:valuestring

The value that configures the adaptivetitle.

Returns:

ColorPickerBuilder

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

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

The value that configures the buttons.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Buttons(false)
)

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

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

The value that configures the buttonstemplate.

Returns:

ColorPickerBuilder

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

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

A Template component that configures the buttonstemplate.

Returns:

ColorPickerBuilder

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

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

The value that configures the buttonstemplate.

Returns:

ColorPickerBuilder

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

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

The value that configures the buttonstemplate.

Returns:

ColorPickerBuilder

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

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

The value that configures the buttonstemplate.

Returns:

ColorPickerBuilder

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

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

The value that configures the clearbutton.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.ClearButton(true)
)

Specifies whether selection of a color in the palette view closes the popup. Applied only when buttons are set to false and the currently selected view is palette.

C#
public ColorPickerBuilder CloseOnSelect(bool value)
Parameters:valuebool

The value that configures the closeonselect.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.CloseOnSelect(true)
)

The number of columns to show in the color dropdown when a pallete is specified. This is automatically initialized for the "basic" and "websafe" palettes. If you use a custom palette then you can set this to some value that makes sense for your colors.

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

The value that configures the columns.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Columns(3)
)

Enables the contrast tool in the ColorGradient.

C#
public ColorPickerBuilder ContrastTool()
Returns:

ColorPickerBuilder

Enables the contrast tool in the ColorGradient.

C#
public ColorPickerBuilder ContrastTool(Action<ColorPickerContrastToolSettingsBuilder> configurator)
Parameters:configuratorAction<ColorPickerContrastToolSettingsBuilder>

The action that configures the contrasttool.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.ContrastTool(tool=&gt;tool
.BackgroundColor("#ffffff")
)
)

Enables the contrast tool in the ColorGradient.

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

Enables or disables the contrasttool option.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.ContrastTool(false)
)

Enables or disables the picker.

C#
public ColorPickerBuilder Enable(bool value)
Parameters:valuebool

Whether the picker is enabled

Returns:

ColorPickerBuilder

Example:
C#
@( Html.Kendo().ColorPicker()
.Name("ColorPicker")
.Enable(false)
)

Configures the client-side events.

C#
public ColorPickerBuilder Events(Action<ColorPickerEventBuilder> clientEventsAction)
Parameters:clientEventsActionAction<ColorPickerEventBuilder>

The client events action.

Returns:

ColorPickerBuilder

Example:
C#
@( Html.Kendo().ColorPicker()
.Name("ColorPicker")
.Events(events =&gt;
events.Select("select").Change("change")
)
)

Sets a value controlling how the color is applied.

C#
public ColorPickerBuilder FillMode(FillMode value)
Parameters:valueFillMode

The value that configures the fillmode.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.FillMode(FillMode.Solid)
)

Defines the format of the gradient input editor

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

The value that configures the format.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Format(ColorPickerFormat.Hex)
)

Sets the available input formats in the gradient input editor.

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

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

Returns:

ColorPickerBuilder

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

Whether to render the input in the ColorGradient component.

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

The value that configures the input.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Input(true)
)

Allows localization of the strings that are used in the widget.

C#
public ColorPickerBuilder Messages(Action<ColorPickerMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<ColorPickerMessagesSettingsBuilder>

The action that configures the messages.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Messages(m =&gt; m.Apply("Update").Cancel("Discard"))
)

Only for the HSV selector. If true, the widget will display the opacity slider. Note that currently in HTML5 the <input type="color"> does not support opacity.

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

The value that configures the opacity.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Opacity(true)
)

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

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

One of the preset palettes of colors

Returns:

ColorPickerBuilder

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

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

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

A list of colors.

Returns:

ColorPickerBuilder

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

Displays the color preview element and the previously selected color for comparison. With buttons set to false, both elements will update at the same time.

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

The value that configures the preview.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Preview(true)
)

Sets a value controlling the border radius.

C#
public ColorPickerBuilder Rounded(Rounded value)
Parameters:valueRounded

The value that configures the rounded.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Rounded(Rounded.Full)
)

Sets the size of the component.

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

The value that configures the size.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Size(ComponentSize.Medium)
)

Sets the size of the palette tiles

C#
public ColorPickerBuilder TileSize(Action<PaletteSizeBuilder> sizeAction)
Parameters:sizeActionAction<PaletteSizeBuilder>

The tile size (for square tiles)

Returns:

ColorPickerBuilder

Example:
C#
@( Html.Kendo().ColorPalette()
.Name("ColorPalette")
.TileSize(s =&gt; s.Width(20).Height(10))
)

Sets the size of the palette tiles

C#
public ColorPickerBuilder TileSize(int tileSize)
Parameters:tileSizeint

The tile size (for square tiles)

Returns:

ColorPickerBuilder

Example:
C#
@( Html.Kendo().ColorPalette()
.Name("ColorPalette")
.TileSize(32)
)

A CSS class name to display an icon in the color picker button. If specified, the HTML for the element will look like this:

C#
public ColorPickerBuilder ToolIcon(string value)
Parameters:valuestring

The value that configures the toolicon.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.ToolIcon("gear")
)

The initially selected color. Note that when initializing the widget from an <input> element, the initial color will be decided by the field instead.

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

The value that configures the value.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.Value("#b72bba")
)

Defines the initially selected view in the ColorPicker.

C#
public ColorPickerBuilder View(ColorPickerView value)
Parameters:valueColorPickerView

The value that configures the view.

Returns:

ColorPickerBuilder

Example:
C#
@(Html.Kendo().ColorPicker()
.Name("palette")
.Views(new string[] { "palette"})
.View(ColorPickerView.Palette)
)

Sets the views of the component.

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

The array value that configures the views.

Returns:

ColorPickerBuilder

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