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

Definition

Constructors

C#
public ColorPicker(ViewContext viewContext, IJavaScriptInitializer initializer, ViewDataDictionary viewData)
Parameters:viewContextViewContextinitializerIJavaScriptInitializerviewDataViewDataDictionary

Properties

Specifies the adaptive rendering of the component.

C#
public AdaptiveMode? AdaptiveMode { get; set; }

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

C#
public string AdaptiveSubtitle { get; set; }

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

C#
public string AdaptiveTitle { get; set; }

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

C#
public bool? Buttons { get; set; }

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

C#
public string ButtonsTemplate { get; set; }

The handler for the ButtonsTemplate

C#
public string ButtonsTemplateHandler { get; set; }

The id for the ButtonsTemplate

C#
public string ButtonsTemplateId { get; set; }

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

C#
public bool? ClearButton { get; set; }

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 bool? CloseOnSelect { get; set; }

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 double? Columns { get; set; }

Enables the contrast tool in the ColorGradient.

C#
public ColorPickerContrastToolSettings ContrastTool { get; set; }
C#
public bool Enabled { get; set; }

Sets a value controlling how the color is applied.

C#
public FillMode? FillMode { get; set; }

Defines the format of the gradient input editor

C#
public ColorPickerFormat? Format { get; set; }
C#
public IEnumerable<string> Formats { get; set; }

Whether to render the input in the ColorGradient component.

C#
public bool? Input { get; set; }

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

C#
public ColorPickerMessagesSettings Messages { get; set; }

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 bool? Opacity { get; set; }
C#
public ColorPickerPalette Palette { get; set; }
C#
public IEnumerable<string> PaletteColors { get; set; }

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 bool? Preview { get; set; }

Sets a value controlling the border radius.

C#
public Rounded? Rounded { get; set; }

Sets the size of the component.

C#
public ComponentSize? Size { get; set; }
C#
public object TileSize { get; set; }

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 string ToolIcon { get; set; }

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 string Value { get; set; }

Defines the initially selected view in the ColorPicker.

C#
public ColorPickerView? View { get; set; }
C#
public IEnumerable<string> Views { get; set; }

Methods

C#
public override IDictionary<string, object> Serialize()
Returns:

IDictionary<string, object>

Overrides: WidgetBase.Serialize()

Implements: IFormEditor.Serialize()

Writes the HTML.

C#
protected override void WriteHtml(HtmlTextWriter writer)
Parameters:writerHtmlTextWriter

Overrides: WidgetBase.WriteHtml(HtmlTextWriter)

Writes the initialization script.

C#
public override void WriteInitializationScript(TextWriter writer)
Parameters:writerTextWriter

The writer.

Overrides: WidgetBase.WriteInitializationScript(TextWriter)