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

Defines the fluent interface for configuring the DatePickerBase component.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class ColorPaletteBuilder : WidgetBuilderBase<ColorPalette, ColorPaletteBuilder>, IHtmlString

Inheritance: objectWidgetBuilderBase<ColorPalette, ColorPaletteBuilder>ColorPaletteBuilder

Implements: IHtmlString

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

C#
public ColorPaletteBuilder(ColorPalette component)
Parameters:componentColorPalette

The component.

Methods

Sets the number of the displayed columns. When using the "WebSafe" palette, the number of columns will automatically default to 18.

C#
public ColorPaletteBuilder Columns(int columns)
Parameters:columnsint

The value that configures the number of columns.

Returns:

ColorPaletteBuilder

Example:
C#
@( Html.Kendo().ColorPalette()
.Name("ColorPalette")
.Columns(5)
)

Handles the client-side events of the ColorPalette..

C#
public ColorPaletteBuilder Events(Action<SimpleColorPickerEventBuilder> clientEventsAction)
Parameters:clientEventsActionAction<SimpleColorPickerEventBuilder>

The action that configures the available events.

Returns:

ColorPaletteBuilder

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

Sets the color palette.

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

The enum value that configures the color palette.

Returns:

ColorPaletteBuilder

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

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

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

A list of colors.

Returns:

ColorPaletteBuilder

Example:
C#
@( Html.Kendo().ColorPalette()
.Name("ColorPalette")
.Palette(new List&lt;string&gt; { "#ff0000", "#00ff00", "#0000ff" })
)
C#
public ColorPaletteBuilder Size(ComponentSize? value)
Parameters:valueComponentSize?Returns:

ColorPaletteBuilder

Defines the size of the palette tiles.

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

The action that configures the tile settings.

Returns:

ColorPaletteBuilder

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

Sets the size of the palette tiles.

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

The tile size (for square tiles).

Returns:

ColorPaletteBuilder

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

Sets the initially selected color.

C#
public ColorPaletteBuilder Value(string color)
Parameters:colorstring

The value that configures the initial color.

Returns:

ColorPaletteBuilder

Example:
C#
@(Html.Kendo().ColorPalette()
.Name("ColorPalette")
.Value("#ff0000")
)