Search code examples
asp.net-mvckendo-uilabelcheckboxfor

how to place a kendo check box label on the left


I have the following peace of code:

    @(Html.Kendo().CheckBoxFor(m => m.IsActive).Label("Active:"))

I would like the label to be on the left as opposed to the right. Can someone help me please?


Solution

  • That cannot be done using the Html helper alone since it always places it on the right. As stated in this link: http://www.telerik.com/forums/checkbox-label-before-checkbox-input

    The Kendo UI checkbox styling requires the rendering to have first the checkbox, then the label tag, so that the latter can be styled, based on the checkbox state

    To get it on the left, you can omit the label from the helper and add the labelling element to your page separately before it, for example:

    <label for="@Model.IsActive">Active:</label>
    @(Html.Kendo().CheckBoxFor(m => m.IsActive))