Category / Section
How to hide the cell contents at initial load in TreeGrid
1 min read
In TreeGrid, user can hide the cell content without affecting the data source. It can be achieved by using QueryCellInfo client-side event. It is also possible to include other formatting options for the cell contents such as strikethrough, inserting hyperlink by using the QueryCellInfo event. Please refer the below code snippets for more details.
MVC
@(Html.EJ().Gantt("Gantt") //… .ClientSideEvents(eve =>{ eve.QueryCellInfo("queryCellInfo"); }) .Datasource(ViewBag.dataSource) ) <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>
You can find a sample for hiding the cell content in a column using QueryCellInfo event here.