I use a ColorPicker in an EditorTemplate of an object edited via Popup of the Grid.
When Editing, it displays the Color of the edited object, that is OK. However, when an object is created, the ColorPicker should display, by default, a random color.
How to detect, in the EditorTemplate, that the object is created, and generate a random color?
<div class="form-group">
<label asp-for="Couleur" class="control-label"></label>
@(Html.Kendo()
.ColorPicker()
.Name("Couleur")
.Value("#ff0000") //"# (0) ? 'yellow' : 'red'#" does not help, it displays black anyway!!!!
.Messages(b => b
.Apply("Appliquer")
.Cancel("Annuler")
.PreviewInput("Prévisualiser"))
)
<span asp-validation-for="Couleur" class="text-danger"></span>
</div>