Search results

Render Palette alone in ASP.NET MVC ColorPicker control

16 Sep 2021 / 1 minute to read

To render the Palette alone in ColorPicker, specify the mode property as Palette, and set the modeSwitcher property to false.

In the following sample, the showButtons property is disabled to hide the control buttons and it renders only the Palette area.

razor
palette-alone.cs
Copied to clipboard
@using Syncfusion.EJ2
@using Syncfusion.EJ2.Inputs
<div class='wrap'>
    <h4>Choose Color</h4>
    @Html.EJS().ColorPicker("element").Mode(ColorPickerMode.Palette).ModeSwitcher(false).ShowButtons(false).Render()
</div>

<style>
    .wrap {
        margin: 0 auto;
        width: 300px;
        text-align: center;
    }
</style>
Copied to clipboard
public ActionResult PaletteAlone()
    {
            return View();
    }

To render Picker alone specify the mode property as ‘Picker’.