Articles in this section
Category / Section

How to remove the junk data, when the string column content contains angular bracket in JSON mode ?

1 min read


String column in the Grid displays junk data (_tmplitem) when the content contains angle brackets (<,>, etc.) in it.


While using jquery templates (jquery.tmpl.js) to render the template in JSON mode Grid, the junkdata (_tmplitem) is added with the angle brackets in the grid data. To resolve this problem in the string columns, replace the columns inner html value with the data of column at runtime by using the QueryCellInfo client side event.


.Column(cols =>
cols.Add(c => c. Title).HeaderText("Title");//Column contains the junk data
.ClientSideEvents(event=>event.QueryCellInfo("QueryCellHandler"))//triggering the QueryCellInfo handler


<script type="text/javascript">
function QueryCellHandler(sender, args) {
if ($(args.Element).hasClass("RowCell") && (args.Element.innerHTML.indexOf("_tmplitem") != -1))
args.Element.innerHTML = args.Data.Title; //replacing the innerhtml of column


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment