Category / Section
How to hide content of specific cells in TreeGrid
In TreeGrid, user can hide the content of the cells of the column without affecting the data source. It can be achieved by using QueryCellInfo client-side event. Please refer the below code snippets for more details.
ASP
<body>
<form id="Form1" runat="server" onsubmit="return false" style="">
<ej:TreeGrid runat="server" ID="TreeGridControlEditing" ChildMapping="Children"
QueryCellInfo="queryCellInfo">
//...
</ej:TreeGrid>
<script type="text/javascript">
function queryCellInfo(args) {
if (args.data.Id == 13) {
if (args.column.field == "Id" || args.column.field == "Name" || args.column.field == "StartDate" || args.column.field == "EndDate") {
args.cellElement.textContent = "DATA HIDDEN";
}
}
}
</script> </form>
</body>