razor - Ajax bound Telerik MVC UI Grid not using DisplayTemplate -


how 1 ajax bound telerik mvc ui grid display format or else display template?

looking @ example here, see grid shows "unit price" column currency symbol. looking @ razor code below see grid ajax bound. unfortunately cannot see viewmodel, "unit price" property not formatted string, since clicking edit button shows numeric textbox. have created editortemplates , displaytemplates , somehow editor templates working.

my viewmodel looks this:

[uihint("moneytemplate")] public decimal itemprice { get; set; } 

where moneytemplate name of display , editor templates views/shared/displaytemplates/moneytemplate.cshtml , views/shared/editortemplates/moneytemplate.cshtml respectively

when grid shows up, display template not picked editor template is?!? this

enter image description here

how did currency symbol show without client side template? why display template not picked up?

after reading through documentation discovered answer use displayformat attribute:

[uihint("moneytemplate")] [displayformat(dataformatstring = "{0:c}")] public decimal itemprice { get; set; } 

this result in grid displaying decimal currency, , using "moneytemplate" editor template editing.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -