Search code examples
razorkendo-uikendonumerictextbox

Kendo NumericTextBox Percent Sign


I am Trying to add the percent sign to the grid. I have found some posts which using this workaround. But this does not work.

"# \%" --> causes a javascript error

@(Html.Kendo().NumericTextBoxFor(m => m)
    .HtmlAttributes(new { style = "width:100%" })
    .Format("\\# \\%")
)

regards


Solution

  • I have found the solution in the telerik forum (http://www.telerik.com/forums/how-to-show-a-percentage-dollar-symbol)

     columns.Bound(e => e.ContractPercent).ClientTemplate("\\#=kendo.format(\"{0:p}\", ContractPercent / 100)\\#").EditorTemplateName("NumberPercent");
    

    regards