Skip to content

CheckBoxFor label cannot be prevented from appearing, if the model field has a DisplayName set #6716

@IvanDanchev

Description

@IvanDanchev

Bug report

Reproduction of the problem

  1. Add a CheckBoxFor helper bound to a model field that has a DisplayName set:
@(Html.Kendo().CheckBoxFor(m => m.IsAvailable).Label(string.Empty))
[Display(Name = "test")]
public bool IsAvailable { get; set; }

Current behavior

Passing string.Empty or "" to the Label option has no effect and a label with text "test" is displayed.

Expected/desired behavior

The text of the DisplayName annotation should not be rendered as label, when an empty string is passed as a parameter to the Label option.

Environment

  • Kendo UI version: 2022.1.119
  • jQuery version: x.y
  • Browser: [all]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions